@@ -131,9 +131,9 @@ def get_env_ctx_peggy2():
131
131
132
132
# TODO We're mixing "OPERATOR" vs. "OWNER"
133
133
# TODO Addressses from dot_env_vars are not in correct EIP55 "checksum" format
134
- # operator_address = web3.Web3.toChecksumAddress (dot_env_vars["ETH_ACCOUNT_OPERATOR_ADDRESS"])
134
+ # operator_address = web3.Web3.to_checksum_address (dot_env_vars["ETH_ACCOUNT_OPERATOR_ADDRESS"])
135
135
# operator_private_key = dot_env_vars["ETH_ACCOUNT_OPERATOR_PRIVATEKEY"][2:]
136
- owner_address = web3 .Web3 .toChecksumAddress (dot_env_vars ["ETH_ACCOUNT_OWNER_ADDRESS" ])
136
+ owner_address = web3 .Web3 .to_checksum_address (dot_env_vars ["ETH_ACCOUNT_OWNER_ADDRESS" ])
137
137
owner_private_key = dot_env_vars .get ("ETH_ACCOUNT_OWNER_PRIVATEKEY" )
138
138
if (owner_private_key is not None ) and (owner_private_key .startswith ("0x" )):
139
139
owner_private_key = owner_private_key [2 :] # TODO Remove
@@ -320,7 +320,7 @@ def _get_overrides_for_smart_contract_addresses(env_vars):
320
320
"BridgeToken" : "BRIDGE_TOKEN_ADDRESS" , # Peggy1 only
321
321
# Missing "Blocklist" missing (Peggy2 only)
322
322
}
323
- return dict (((k , web3 .Web3 .toChecksumAddress (env_vars [v ])) for k , v in mappings .items () if v in env_vars ))
323
+ return dict (((k , web3 .Web3 .to_checksum_address (env_vars [v ])) for k , v in mappings .items () if v in env_vars ))
324
324
325
325
326
326
def sif_addr_to_evm_arg (sif_address ):
@@ -408,7 +408,7 @@ def tx_get_sc_at(self, sc_name, address):
408
408
def smart_contract_get_past_events (self , sc , event_name , from_block = None , to_block = None ):
409
409
from_block = from_block if from_block is not None else 1
410
410
to_block = str (to_block ) if to_block is not None else "latest"
411
- filter = sc .events [event_name ].createFilter (fromBlock = from_block , toBlock = to_block )
411
+ filter = sc .events [event_name ].create_filter (fromBlock = from_block , toBlock = to_block )
412
412
try :
413
413
return filter .get_all_entries ()
414
414
finally :
@@ -534,7 +534,7 @@ def get_whitelisted_tokens_from_bridge_bank_past_events(self):
534
534
for e in past_events :
535
535
token_addr = e .args ["_token" ]
536
536
value = e .args ["_value" ]
537
- assert web3 .Web3 .toChecksumAddress (token_addr ) == token_addr
537
+ assert web3 .Web3 .to_checksum_address (token_addr ) == token_addr
538
538
# Logically the whitelist only consists of entries that have the last value of True.
539
539
# If the data is clean, then for each token_addr we should first see a True event, possibly
540
540
# followed by alternating False and True. The last value is the active one.
@@ -605,7 +605,7 @@ def send_erc20_from_ethereum_to_sifchain(self, from_eth_addr, dest_sichain_addr,
605
605
# # When transfering ERC20, the amount needs to be passed as argument, and the "message.value" should be 0
606
606
# # TODO Error handling
607
607
# # "web3.exceptions.ContractLogicError: execution reverted: SafeERC20: low-level call failed" in case that amount is more than what is available / what was "approved" to BridgeBank
608
- # tx = bridge_bank.functions.lock(recipient, erc20_token_addr, amount).buildTransaction ({
608
+ # tx = bridge_bank.functions.lock(recipient, erc20_token_addr, amount).build_transaction ({
609
609
# "from": self.operator,
610
610
# "nonce": self.w3_conn.eth.get_transaction_count(self.operator)
611
611
# })
@@ -787,7 +787,7 @@ def send_from_ethereum_to_sifchain(self, from_eth_acct: str, to_sif_acct: str, a
787
787
# Peggy1-specific
788
788
def set_ofac_blocklist_to (self , addrs ):
789
789
blocklist_sc = self .get_blocklist_sc ()
790
- addrs = [web3 .Web3 .toChecksumAddress (addr ) for addr in addrs ]
790
+ addrs = [web3 .Web3 .to_checksum_address (addr ) for addr in addrs ]
791
791
existing_entries = blocklist_sc .functions .getFullList ().call ()
792
792
to_add = [addr for addr in addrs if addr not in existing_entries ]
793
793
to_remove = [addr for addr in existing_entries if addr not in addrs ]
0 commit comments