-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port useful abi utility methods to public utils directory #3036
Comments
I'm curious if we also want to consider moving abi functions that reside in Another option, which may not make sense, is to move all things to |
eth-abi houses the implementation for ABI encoding & decoding. I think it's a reasonable abstraction to leave that to its own library / repository. I wouldn't be against using eth_utils a bit more for "public" utils though if it makes sense to - even if we end up exposing it via web3.py where / if necessary. The distinction of what should live in eth-utils vs web3.utils is one that would be good to think about. If the answer is "everything" then we can just port useful fxns over to eth_utils and call that the public utilities. |
In #1596 we decided most functions which deal with a contract's ABI belong closer to its context within Web3. We started releasing event and function helpers publicly via When other functions are exposed, consider whether it is a generalized util and might fit best in |
We have many handy abi utility methods that live under the
web3._utils.abi
directory that could be made stable / public via our public utilities directory inweb3.utils.abi
. Something that comes to mind is a method likeencode_method_call(fn_signature, params)
, for example.Some of these could make more sense if they lived in
eth-abi(maybe eth-utils makes more sense as mentioned below) and could be exposed throughweb3.py
if desired, sort of like how the eth-utils methodsto_hex()
,to_bytes()
, etc, are passed through viaWeb3.to_bytes()
...This seems like a low-hanging fruit since that logic exists internally in the web3.py library. Making it public and massaging it into methods that are easy to understand and use could go a long way.
The text was updated successfully, but these errors were encountered: