by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Ben Hauser
    @iamdefinitelyahuman
    (stateful testing in hypothesis is meant to work with unittest, not pytest)
    Matthias Nadler
    @matnad
    oh nice, yeah i'll have to get into stateful testing eventually :D Have never look at it so far
    Ben Hauser
    @iamdefinitelyahuman
    i'm not sure what the implementation would even look like, but i'd love to advance the stateful testing so it's more of a greybox process than a blackbox process
    combine it with the coverage evaluation and so it can learn "this series of actions gets me into this branch"
    and then try to add stuff like... first you'd run it in a mode where it's priority is to learn to reach all the branches. then you can tell it "only explore this branch", maybe.
    or you could design tests where you basically say "given these rules, you should never be able to get to this branch"
    i dunno... the possibilities are pretty huge but also i have literally 0 idea what implementing this actually looks like ahahaha
    right now it's just a distant dream
    Matthias Nadler
    @matnad
    Yeah that sounds very powerful.. i'll definitely have to read up on it first tho :sweat_smile:
    Benjamin Cordes
    @benjyz
    somebody running brownie in production with react? I'm building on web3 and flask and looking into this
    Matthias Nadler
    @matnad
    Sure, with redux, web3 and rimblueUI you can build a great frontend
    But since brownie is written in python and react in JS there will not be much integration. Ususally, it is sufficient to just load the json artifacts from the build directory if you are working with your own smart contracts. If you are working with other contracts having access to brownie fom inside flask/django would definitevly be powerful
    Adrian Guerrera
    @apguerrera
        function returnNow() public view returns (uint256) {
            return now;
        }
    Now if I rpc.sleep(10000), that number doesnt change?
    Or should it?
        print(rpc.time())
        rpc.sleep(100000)
        print(rpc.time())
        print(dutch_auction.returnNow())
    Give me
    1590430653
    1590530653
    1590430651
    Ok problem averted, rpc.sleep(10000) moves the clock forward, rpc.mine() mines a block so "now" see it
    skyge
    @Skyge
    Emmm, I also found this, so I always use the following method to change time:
    rpc.sleep(10)
    rpc.mine(10)

    Ok problem averted, rpc.sleep(10000) moves the clock forward, rpc.mine() mines a block so "now" see it

    That makes sense.

    Adrian Guerrera
    @apguerrera
    Does the solidity compiler check if I dont have a return in my function? A pretty embarrasing mistake was on twitter where functions didnt have a return defined
    Bryant Eisenbach
    @fubuloubu
    I don't think it does, but you don't need a return statement to return something:
    function foo() returns (uint bar) { bar = block.timestamp; }
    But yeah, I don't think it checks if you fail to return something
    Note that Vyper does :)
    Adrian Guerrera
    @apguerrera
    function foo() returns (uint) -> but forget to return anything
    There was a BTC wrapper contract that missed it. Was an embarrasing error for them
    David Núñez
    @cygnusv
    Hi! Small question: is it possible to import 3rd party python packages in brownie console?
    David Núñez
    @cygnusv
    oh nevermind, it works, it seems it was a problem with my venv
    Benjamin Cordes
    @benjyz
    @matnad but since almost all dapps have JS, the frontend needs different pipeline. in truffle can be a single one. I think an example on github of brownie and JS in use could be helpful
    truffle has a react box. I am building towards having a brownie/vyper/react stack
    Matthias Nadler
    @matnad
    Yeah sure I can make a plugin for this
    peppeppep
    @peppeppep
    has anyone run into an issue where abis generated by brownie don't work as expected? I'm migrating from truffle 5 to brownie and got my deployment script set up - copied over the abis that brownie built as well as the new contract addresses, but in the console for my dapp i get errors relating to the abi being incorrect - i can confirm that using the abis from truffle for the same project/contracts works as expected
    Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
    peppeppep
    @peppeppep

    upon closer inspection i see this in the ganache output, which is where the tx ids and other info related to the deployment are -

    evm_snapshot
    Saved snapshot #11
    evm_revert
    Reverting to snapshot #1
    eth_blockNumber

    which probably explains why the dapp cant talk to the contracts - the EVM reverted back to initial state after deployment

    peppeppep
    @peppeppep
    I was able to work around that issue by defining a network for my local dev node, but I'm running into another issue - ContractNotFound: No contract deployed at 0x7c2C195CD6D34B8F845992d380aADB2730bB9C6F which is strange since i'm using the same deploy script that worked successfully earlier (albeit with the snapshot/reverting)
    Ben Hauser
    @iamdefinitelyahuman
    hi @peppeppep. when brownie is using a development network it reverts to the original state when the session finishes. i hadn't thought about a use-case where you'd want the state to persist, but for front-end work i can see how that's useful. i can adjust this behavior in the next release, hopefully later today.
    declaring ganache as a live environment is the workaround - but seems you already found that.
    the issue with ContractNotFound is because while using a live environment, deployment info persists between sessions... @matnad is working on a brownie-react setup and i think has already encountered and solved this problem, so it should also be dealt with in the next release :)
    Célio Rodrigues
    @celioggr
    Hi everyone, for those experimenting brownie with state machines here is a github repository with some real world contracts being tested by means of brownie test machines. The contracts are organized by category of bug . This is my first attempt to use brownie for testing contracts in the wild so it is at a very early stage. Fell free to share feedback or contribute
    Ben Hauser
    @iamdefinitelyahuman
    @celioggr nice!
    Benjamin Cordes
    @benjyz
    @matnad a full example backend+frontend on github would be very helpful to get started
    Benjamin Cordes
    @benjyz
    with truffle can use e.g. react box
    Matthias Nadler
    @matnad
    @benjyz the example is ready and we made some supporting changes in 1.9 which will hopefully be released very soon! :)
    Ben Hauser
    @iamdefinitelyahuman
    v1.9.0 is out! and this is a huuuge one https://github.com/eth-brownie/brownie/releases/tag/v1.9.0
    Benjamin Cordes
    @benjyz
    @matnad awesome, happy to test
    Matthias Nadler
    @matnad
    Enjoy :)
    There is an additional branch in the repo if you prefer ethers.js over web3.js