Skip to content
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

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

reedsa
Copy link
Contributor

@reedsa reedsa commented Mar 12, 2024

What was wrong?

Related to Issue #3278

How was it fixed?

Updated references and deprecated the encodeABI method.

Todo:

Cute Animal Picture

Screen Shot 2024-03-13 at 11 31 39 AM

@reedsa reedsa changed the title Rename Contract.encodeABI -> Contract.encode_abi [v6] Rename Contract.encodeABI -> Contract.encode_abi Mar 12, 2024
reedsa added a commit to reedsa/web3.py that referenced this pull request Mar 12, 2024
@reedsa reedsa force-pushed the v6-rename-encode-abi branch from 9f791c7 to 6a2fc30 Compare March 12, 2024 23:34
reedsa added a commit to reedsa/web3.py that referenced this pull request Mar 13, 2024
@reedsa reedsa force-pushed the v6-rename-encode-abi branch from 6a2fc30 to 2b9e863 Compare March 13, 2024 15:42
@reedsa reedsa marked this pull request as ready for review March 13, 2024 17:31
reedsa added a commit to reedsa/web3.py that referenced this pull request Mar 13, 2024
@reedsa reedsa force-pushed the v6-rename-encode-abi branch from 2b9e863 to a4cb583 Compare March 13, 2024 17:34
@reedsa reedsa force-pushed the v6-rename-encode-abi branch from a4cb583 to bf5fdfc Compare March 13, 2024 17:36
@reedsa reedsa requested review from fselmo, pacrob and kclowes March 13, 2024 17:36
Copy link
Contributor

@pacrob pacrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Collaborator

@kclowes kclowes left a 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!

tests/core/contracts/test_contract_method_abi_encoding.py Outdated Show resolved Hide resolved


@patch("web3.eth.Contract.encodeABI", lambda w3, *args, **kwargs: (args, kwargs))
def test_contract_encodeABI_deprecated_calls_encode_abi_with_args(w3):
Copy link
Collaborator

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?

Copy link
Contributor Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice! TIL

@reedsa reedsa merged commit cc23d9d into ethereum:v6 Mar 13, 2024
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants