-
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
[v6] Rename Contract.encodeABI
-> Contract.encode_abi
#3280
Conversation
Contract.encodeABI
-> Contract.encode_abi
Contract.encodeABI
-> Contract.encode_abi
9f791c7
to
6a2fc30
Compare
6a2fc30
to
2b9e863
Compare
2b9e863
to
a4cb583
Compare
a4cb583
to
bf5fdfc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple comments around the tests, but feel free to take or leave!
|
||
|
||
@patch("web3.eth.Contract.encodeABI", lambda w3, *args, **kwargs: (args, kwargs)) | ||
def test_contract_encodeABI_deprecated_calls_encode_abi_with_args(w3): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test add any new test vector? It looks like the test above tests kwargs already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test expects the new method to be called with all the arguments. The @patch
wraps the encode function to be able to check values for each argument.
"0xea87152b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000087261696e626f7773000000000000000000000000000000000000000000000000" | ||
|
||
.. py:classmethod:: Contract.encodeABI(fn_name, args=None, kwargs=None, data=None) | ||
|
||
.. deprecated:: 7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice! TIL
What was wrong?
Related to Issue #3278
How was it fixed?
Updated references and deprecated the encodeABI method.
Todo:
Cute Animal Picture