You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contract calls raise a DeprecationWarning due to encode_abi being renamed to encode in eth_abi:
return self.contract.functions.decimals().call()
[snip]/lib/python3.10/site-packages/web3/contract.py:1228: in call
return call_contract_function(
[snip]/lib/python3.10/site-packages/web3/contract.py:1982: in call_contract_function
call_transaction = prepare_transaction(
[snip]/lib/python3.10/site-packages/web3/_utils/contracts.py:263: in prepare_transaction
prepared_transaction["data"] = encode_transaction_data(
[snip]/lib/python3.10/site-packages/web3/_utils/contracts.py:303: in encode_transaction_data
return add_0x_prefix(encode_abi(w3, fn_abi, fn_arguments, fn_selector))
[snip]/lib/python3.10/site-packages/web3/_utils/contracts.py:218: in encode_abi
encoded_arguments = w3.codec.encode_abi(
-------
def encode_abi(self, types: Iterable[TypeStr], args: Iterable[Any]) -> bytes:
"""
Encodes the python values in ``args`` as a sequence of binary values of
the ABI types in ``types`` via the head-tail mechanism.
:param types: An iterable of string representations of the ABI types
that will be used for encoding e.g. ``('uint256', 'bytes[]',
'(int,int)')``
:param args: An iterable of python values to be encoded.
:returns: The head-tail encoded binary representation of the python
values in ``args`` as values of the ABI types in ``types``.
"""
> warnings.warn(
"abi.encode_abi() and abi.encode_abi_packed() are deprecated and will be "
"removed in version 4.0.0 in favor of abi.encode() and "
"abi.encode_packed(), respectively",
category=DeprecationWarning,
)
E DeprecationWarning: abi.encode_abi() and abi.encode_abi_packed() are deprecated and will be removed in version 4.0.0 in favor of abi.encode() and abi.encode_packed(), respectively
How can it be fixed?
Call encode instead of encode_abi as directed by the eth_abi warning.
Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.
The text was updated successfully, but these errors were encountered:
What was wrong?
Contract calls raise a
DeprecationWarning
due toencode_abi
being renamed toencode
ineth_abi
:How can it be fixed?
Call
encode
instead ofencode_abi
as directed by theeth_abi
warning.Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.
The text was updated successfully, but these errors were encountered: