Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    FI
    @step21_gitlab
    @learnPytho
    FI
    @step21_gitlab
    thanks that seems to have helped. Kinda thought any function could be used for that.
    learnPytho
    @learnPytho
    cool!
    0xRS
    @0xRS
    Hi guys. What's the best way to automate testing of cross-chain apps (Specifically eth-xdai)? Currently I run separate brownie consoles simultaneously for the two chains and run tests sequentially. Can I switch networks inside a script?
    Bryan Apperson
    @bryanapperson
    Hey, I am trying to use brownie in scripting via the API, rather than in pytest.
    However, interface doesn't seem to be available anywhere, and the docs seem out of date. How are you all using interface?
    UrAvgDeveloper
    @UrAvgDeveloper

    Hi, I have created a script in brownie. Is it possible to pass parameters in the script main function from the command line?

    scripts/test.py:

    def main(param):
    print(param)

    From cmd:
    brownie run test main('abcd')

    Is this possible?

    FI
    @step21_gitlab
    @UrAvgDeveloper like with any python script? look up argparse if you do not want to handle arguments manually
    for time based tests, how does everyone here calculate timedelta etc? Just in your head? :)
    (Timedelta if passing to chain.mine() or seconds if passing to chain.sleep()
    FI
    @step21_gitlab
    that feeling when you submit a security analysis and it does not really find anything. Feels weird.
    though on looking at the report in brownie I got
      File "brownie/_cli/__main__.py", line 64, in main
        importlib.import_module(f"brownie._cli.{cmd}").main()
      File "brownie/_cli/analyze.py", line 344, in main
        submission.generate_highlighting_report()
      File "brownie/_cli/analyze.py", line 252, in generate_highlighting_report
        SEVERITY_COLOURS[severity],
    KeyError: ‚UNKNOWN'
    On the web it is fine.
    I guess brownie got confused that it didn’t find any issues?
    learnPytho
    @learnPytho
    Can I please get an answer on brownie.reverts() module not being found? It has been days are there any brownie devs that check this chat? Should I be asking this in a discord?
    learnPytho
    @learnPytho
    Is it because I need to run my own node like debug trace?
    Just some guy
    @fubuloubu
    if you're not using Ganache you're going to have problems with that feature I think
    FI
    @step21_gitlab
    yeah. do you mean you are running your own node? If yes, debugging is definitely gonna be harder
    Just some guy
    @fubuloubu
    I don't think nodes expose that endpoint by default
    you have to enable it
    ganache enables by default
    Just some guy
    @fubuloubu
    There is a new discord for Ethereum and Python discussions, including a Brownie channel here:
    https://discord.gg/PcEJ54yX
    Just some guy
    @fubuloubu
    Updated link for Discord, that one expired: https://discord.gg/abJEARdx3Q
    Loophe Lau
    @loophe
    hei , there, how can run a brownie on a certain block, I just tried but stucked
    Just some guy
    @fubuloubu
    there's a #brownie channel in the discord
    kjr217
    @kjr217
    Hi guys, ive run into a really nasty error that i cant seem to fix. The error doesn't make sense, since I removed the event in the function and it still returns this error even after recompiling and deleting topics.json. Any help would be much appreciated
    inputs = [{'indexed': True, 'internalType': 'address', 'name': 'from', 'type': 'address'}, {'indexed': True, 'internalType': 'a...', 'name': 'to', 'type': 'address'}, {'indexed': False, 'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}]
    topics = ['0x0000000000000000000000000000000000000000000000000000000000000000', '0x0000000000000000000000000aa08cf02c3c96711d9b3e44ae40d8226edb5e81', '0x0000000000000000000000000000000000000000000000000000000000000000']
    data = '0x'
    
        def _decode(inputs: List, topics: List, data: str) -> List:
            indexed_count = len([i for i in inputs if i["indexed"]])
    
            if indexed_count and not topics:
                # special case - if the ABI has indexed values but the log does not,
                # we should still be able to decode the data
                unindexed_types = inputs
    
            else:
                if indexed_count < len(topics):
                    raise EventError(
    >                   "Event log does not contain enough topics for the given ABI - this"
                        " is usually because an event argument is not marked as indexed"
                    )
    E               eth_event.main.EventError: Event log does not contain enough topics for the given ABI - this is usually because an event argument is not marked as indexed
    
    ../../.local/pipx/venvs/eth-brownie/lib/python3.6/site-packages/eth_event/main.py:302: EventError
    XtrudedSpace
    @xtruded_space_twitter
    Hi, is there a way to use a local hardhat blockchain instead of ganache with brownie?
    Just some guy
    @fubuloubu
    @xtruded_space_twitter WIP

    Updated link for Discord, that one expired: https://discord.gg/abJEARdx3Q

    @kjr217 you can get help in this discord!

    Stoned Farmer CryptoRootz.eth 🌍🧑🏿‍🚀🔫🧑🏿‍🚀
    @CryptoRootz_twitter
    why do i keep getting this error: brownie: command not found
    Nate Mueller
    @c0rv0s
    hey I'm having a weird issue with brownie that I can't quite pin down
    Screen Shot 2021-02-18 at 7.43.30 PM.png

    I'm trying to run tests via brownie test but this is the error that I get. It seems that the global web3 object has None for its provider attribute despite the ganache-cli rpc launching successfully

    I also tried running the offending code inside of the brownie console and there were no issues - web3 had a provider and everything so its only during the test command

    learnPytho
    @learnPytho
    @c0rv0s are you using infura. It seems like an issue with the provider, many brownie features require you to run your own node
    @CryptoRootz_twitter its not installed correctly. Try typing brownie -v.
    Marius
    @mariuspod
    hey all :-)
    I'm having some issues with brownie attaching to a RPC process running inside a docker container on linux. I've narrowed it down to the check of the processes running on the host and the open connections. I've found an easy fix by testing for psutil.net_connections() which seems to work for host-based and dockerized RPC attaching on linux.
    Here's my commit: mariuspod/brownie@45cd7be
    just not sure if there's another way to attach to an RPC inside docker. Happy to create a PR if that's useful.
    Marius
    @mariuspod
    I'm running brownie on the host and ganache-cli inside a docker container.
    Max
    @blutooth
    Hey guys, how are you working with upgradeable contracts?
    Max
    @blutooth
    Or anyone know how to install an npm package?
    Satoshi Naoki
    @Satoshi-Naoki
    image.png
    I get this error when I run brownie test, is here anyone knows how to handle this?
    vfurci200
    @vfurci200

    Hi guys, can't fetch this Aave pool contract:
    $ brownie console --network mainnet-fork

    Contract.from_explorer("0x7d2768dE32b0b80b7a3454c06BdAc94A69D
    Dc7A9")

    Fetching source of 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9 from api.etherscan.io...
    File "<console>", line 1, in <module>
    File "brownie/network/contract.py", line 1103, in from_explorer
    as_proxy_for = _resolve_address(implementation_eip1967[12:])
    File "brownie/network/web3.py", line 192, in _resolve_address
    return to_address(domain)
    File "brownie/convert/main.py", line 43, in to_address
    return str(EthAddress(value))
    File "brownie/convert/datatypes.py", line 204, in new
    raise ValueError(f"'{value}' is not a valid ETH address") from None
    ValueError: 'b'\x92xw\xef\xdaB[\xaf'' is not a valid ETH address

    Any help?
    I see the same issue here: https://www.gitmemory.com/issue/eth-brownie/brownie/963/782712384

    Thank you

    Grant Steuart
    @GMSteuart
    @mariuspod do you have the ports forwarded in the config?
    quantaf1re
    @quantaf1re
    Hey does anyone know how to ensure the the random numbers generated via property testing/strategy are actually uniformly random? It keeps generating numbers much closer to the min_value I have set all the time
    quantaf1re
    @quantaf1re
    I believe the name for this is 'shrinking' - how to turn it off?
    quantaf1re
    @quantaf1re

    From the config example in brownie's docs:

    hypothesis:
        deadline: null
        max_examples: 50
        report_multiple_bugs: False
        stateful_step_count: 10
        phases:
            explicit: true
            reuse: true
            generate: true
            target: true
            shrink: true

    How to turn it off in the settings of a stateful test?
    settings = {"stateful_step_count": 50, "max_examples": 10, "phases": {"shrink":False}}
    gives the error: hypothesis.errors.InvalidArgument: 'shrink' is not a valid phase

    vfurci200
    @vfurci200

    Hi guys, can't fetch this Aave pool contract:
    $ brownie console --network mainnet-fork

    Contract.from_explorer("0x7d2768dE32b0b80b7a3454c06BdAc94A69D
    Dc7A9")

    Fetching source of 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9 from api.etherscan.io...
    File "<console>", line 1, in <module>
    File "brownie/network/contract.py", line 1103, in from_explorer
    as_proxy_for = _resolve_address(implementation_eip1967[12:])
    File "brownie/network/web3.py", line 192, in _resolve_address
    return to_address(domain)
    File "brownie/convert/main.py", line 43, in to_address
    return str(EthAddress(value))
    File "brownie/convert/datatypes.py", line 204, in new
    raise ValueError(f"'{value}' is not a valid ETH address") from None
    ValueError: 'b'\x92xw\xef\xdaB[\xaf'' is not a valid ETH address

    Any help?
    I see the same issue here: https://www.gitmemory.com/issue/eth-brownie/brownie/963/782712384

    Thank you
    for future reference, this happens because the contract fetched is a proxy contract, so the second argument (as_proxy_for) needs to be added or brownie will try to resolve the reserved EIP1967 storage address and crash. I think Brownie could give a warning for this