@@ -616,10 +616,11 @@ def update_settings(self, new_settings: dict):
616
616
self .provider_settings .update (new_settings )
617
617
self .connect ()
618
618
619
- def estimate_gas_cost (self , txn : TransactionAPI ) -> int :
619
+ def estimate_gas_cost (self , txn : TransactionAPI , ** kwargs ) -> int :
620
620
txn_dict = txn .dict ()
621
621
try :
622
- return self ._web3 .eth .estimate_gas (txn_dict ) # type: ignore
622
+ block_id = kwargs .pop ("block_identifier" , None )
623
+ return self .web3 .eth .estimate_gas (txn_dict , block_identifier = block_id ) # type: ignore
623
624
except ValueError as err :
624
625
tx_error = self .get_virtual_machine_error (err )
625
626
@@ -657,27 +658,33 @@ def get_block(self, block_id: BlockID) -> BlockAPI:
657
658
block_data = dict (self .web3 .eth .get_block (block_id ))
658
659
return self .network .ecosystem .decode_block (block_data )
659
660
660
- def get_nonce (self , address : str ) -> int :
661
- return self .web3 .eth .get_transaction_count (address ) # type: ignore
661
+ def get_nonce (self , address : str , ** kwargs ) -> int :
662
+ block_id = kwargs .pop ("block_identifier" , None )
663
+ return self .web3 .eth .get_transaction_count (address , block_identifier = block_id )
662
664
663
665
def get_balance (self , address : str ) -> int :
664
- return self .web3 .eth .get_balance (address ) # type: ignore
666
+ return self .web3 .eth .get_balance (address )
665
667
666
668
def get_code (self , address : str ) -> bytes :
667
- return self .web3 .eth .get_code (address ) # type: ignore
669
+ return self .web3 .eth .get_code (address )
668
670
669
- def get_storage_at (self , address : str , slot : int ) -> bytes :
671
+ def get_storage_at (self , address : str , slot : int , ** kwargs ) -> bytes :
672
+ block_id = kwargs .pop ("block_identifier" , None )
670
673
try :
671
- return self .web3 .eth .get_storage_at (address , slot ) # type: ignore
674
+ return self .web3 .eth .get_storage_at (
675
+ address , slot , block_identifier = block_id
676
+ ) # type: ignore
672
677
except ValueError as err :
673
678
if "RPC Endpoint has not been implemented" in str (err ):
674
679
raise APINotImplementedError (str (err )) from err
675
680
676
681
raise # Raise original error
677
682
678
- def send_call (self , txn : TransactionAPI ) -> bytes :
683
+ def send_call (self , txn : TransactionAPI , ** kwargs ) -> bytes :
679
684
try :
680
- return self .web3 .eth .call (txn .dict ())
685
+ block_id = kwargs .pop ("block_identifier" , None )
686
+ state = kwargs .pop ("state_override" , None )
687
+ return self .web3 .eth .call (txn .dict (), block_identifier = block_id , state_override = state )
681
688
except ValueError as err :
682
689
raise self .get_virtual_machine_error (err ) from err
683
690
0 commit comments