Skip to content

Commit 5956275

Browse files
author
Stuart Reed
committed
Use ens_resolver normalizer
1 parent e8a13bf commit 5956275

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

web3/_utils/contracts.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
from web3._utils.method_formatters import (
7070
to_integer_if_hex,
7171
)
72+
from web3._utils.normalizers import (
73+
abi_ens_resolver,
74+
)
7275
from web3.exceptions import (
7376
BlockNumberOutOfRange,
7477
Web3TypeError,
@@ -281,7 +284,12 @@ def encode_transaction_data(
281284

282285
return add_0x_prefix(
283286
encode_abi(
284-
fn_abi, fn_arguments, data=fn_selector, strict=w3.strict_bytes_type_checking
287+
fn_abi,
288+
fn_arguments,
289+
data=fn_selector,
290+
abi_codec=w3.codec,
291+
data_normalizers=[abi_ens_resolver(w3)],
292+
strict=w3.strict_bytes_type_checking,
285293
)
286294
)
287295

web3/contract/base_contract.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
)
8080
from web3._utils.normalizers import (
8181
BASE_RETURN_NORMALIZERS,
82+
abi_ens_resolver,
8283
)
8384
from web3.datastructures import (
8485
AttributeDict,
@@ -618,6 +619,7 @@ def _encode_transaction_data(cls) -> HexStr:
618619
cls.arguments,
619620
data=cls.selector,
620621
abi_codec=cls.w3.codec,
622+
data_normalizers=[abi_ens_resolver(cls.w3)],
621623
strict=cls.w3.strict_bytes_type_checking,
622624
)
623625
)
@@ -764,6 +766,7 @@ def encode_abi(
764766
fn_arguments,
765767
data,
766768
abi_codec=cls.w3.codec,
769+
data_normalizers=[abi_ens_resolver(cls.w3)],
767770
strict=cls.w3.strict_bytes_type_checking,
768771
)
769772

@@ -910,6 +913,7 @@ def _encode_constructor_data(
910913
arguments,
911914
data=cls.bytecode,
912915
abi_codec=cls.w3.codec,
916+
data_normalizers=[abi_ens_resolver(cls.w3)],
913917
strict=cls.w3.strict_bytes_type_checking,
914918
)
915919
)
@@ -1098,6 +1102,7 @@ def _encode_data_in_transaction(self, *args: Any, **kwargs: Any) -> HexStr:
10981102
arguments,
10991103
data=self.bytecode,
11001104
abi_codec=self.w3.codec,
1105+
data_normalizers=[abi_ens_resolver(self.w3)],
11011106
strict=self.w3.strict_bytes_type_checking,
11021107
)
11031108
)

0 commit comments

Comments
 (0)