Skip to content

Commit 4ae59ac

Browse files
committed
Fix issues with rebasing and update description for simpler block_id method
1 parent 693e68f commit 4ae59ac

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

web3/contract/async_contract.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ def __init__(
571571
ccip_read_enabled: Optional[bool] = None,
572572
decode_tuples: Optional[bool] = False,
573573
) -> None:
574-
super().__init__(abi, w3, address)
574+
super().__init__(abi, w3, address, decode_tuples=decode_tuples)
575+
575576
if self.abi:
576577
if transaction is None:
577578
transaction = {}
@@ -587,8 +588,8 @@ def __init__(
587588
decode_tuples=decode_tuples,
588589
)
589590

590-
# TODO: This is a hack to get around the fact that we can't call the
591-
# full async method from within a class's __init__ method. We'll need
591+
# TODO: The no_extra_call method gets around the fact that we can't call
592+
# the full async method from within a class's __init__ method. We need
592593
# to see if there's a way to account for all desired elif cases.
593594
block_id = parse_block_identifier_no_extra_call(
594595
self.w3, block_identifier
@@ -599,7 +600,6 @@ def __init__(
599600
transaction=transaction,
600601
block_identifier=block_id,
601602
ccip_read_enabled=ccip_read_enabled,
602-
decode_tuples=decode_tuples,
603603
)
604604

605605
setattr(self, func["name"], caller_method)

web3/contract/base_contract.py

+2
Original file line numberDiff line numberDiff line change
@@ -1050,10 +1050,12 @@ def __init__(
10501050
abi: ABI,
10511051
w3: Union["Web3", "AsyncWeb3"],
10521052
address: ChecksumAddress,
1053+
decode_tuples: Optional[bool] = False,
10531054
) -> None:
10541055
self.w3 = w3
10551056
self.address = address
10561057
self.abi = abi
1058+
self.decode_tuples = decode_tuples
10571059
self._functions = []
10581060

10591061
def __getattr__(self, function_name: str) -> Any:

web3/contract/contract.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def __init__(
565565
ccip_read_enabled: Optional[bool] = None,
566566
decode_tuples: Optional[bool] = False,
567567
) -> None:
568-
super().__init__(abi, w3, address)
568+
super().__init__(abi, w3, address, decode_tuples=decode_tuples)
569569

570570
if self.abi:
571571
if transaction is None:
@@ -589,7 +589,6 @@ def __init__(
589589
transaction=transaction,
590590
block_identifier=block_id,
591591
ccip_read_enabled=ccip_read_enabled,
592-
decode_tuples=decode_tuples,
593592
)
594593

595594
setattr(self, func["name"], caller_method)

0 commit comments

Comments
 (0)