Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Upgrade web3 dependency to 5.18.0, replace soon to be deprecated methods, and add additional middleware to maintain backwards compatibility (SolidityError/ContractLogicError)
A majority of this is just some grepppppping to change method names from camelCase to snake_case :)
Related issue: #1048 #1010
Additional Info:
In the 5.13.0 release of web3, there is a new error formatter middleware for
eth_call
andeth_estimateGas
rpc methods, this formatter instead of passing along the rpc response, instead it raises a ContractLogicError with a (pretty meh) message, but granted it's for end users. For brownie, all we have to really do is bypass that middlware by adding our own prior to it, and raise a ValueError with the appropriate RPCError dict. This is then used to raise a VirtualMachineError when a transaction reverts etc ....References: ethereum/web3.py#941 ethereum/web3.py#1814
How I did it
Used pip-compile -P web3 {,requirements-dev.in,requirements-windows.in}
How to verify it
Since this is supposed to be mainly upgrading the dependencies and not adding any new features, the entire test suite should pass across all builds.
I've also tested using multiple different repos which utilize brownie (the curvefi org of tests)
Checklist