diff --git a/web3/_utils/contracts.py b/web3/_utils/contracts.py index 997ca6a8fd..71d09b87cf 100644 --- a/web3/_utils/contracts.py +++ b/web3/_utils/contracts.py @@ -139,27 +139,21 @@ def encode_abi(web3, abi, arguments, data=None): ) ) - try: - normalizers = [ - abi_ens_resolver(web3), - abi_address_to_hex, - abi_bytes_to_bytes, - abi_string_to_text, - ] - normalized_arguments = map_abi_data( - normalizers, - argument_types, - arguments, - ) - encoded_arguments = eth_abi_encode_abi( - argument_types, - normalized_arguments, - ) - except EncodingError as e: - raise TypeError( - "One or more arguments could not be encoded to the necessary " - "ABI type: {0}".format(str(e)) - ) + normalizers = [ + abi_ens_resolver(web3), + abi_address_to_hex, + abi_bytes_to_bytes, + abi_string_to_text, + ] + normalized_arguments = map_abi_data( + normalizers, + argument_types, + arguments, + ) + encoded_arguments = eth_abi_encode_abi( + argument_types, + normalized_arguments, + ) if data: return to_hex(HexBytes(data) + encoded_arguments)