diff --git a/tests/integration/test_config.py b/tests/integration/test_config.py index ba0bd00..a47fe5e 100644 --- a/tests/integration/test_config.py +++ b/tests/integration/test_config.py @@ -31,5 +31,5 @@ class TestEnvironment: LOCAL_ENV = TestEnvironment( - EnvType.LOCAL_HOST, "http://localhost:15100", "http://127.0.0.1:15045" + EnvType.LOCAL_HOST, "http://localhost:3050", "http://127.0.0.1:8545" ) diff --git a/tests/integration/test_wallet.py b/tests/integration/test_wallet.py index 280c778..0429816 100644 --- a/tests/integration/test_wallet.py +++ b/tests/integration/test_wallet.py @@ -52,8 +52,8 @@ def setUp(self) -> None: self.CONTRACT_ADDRESS = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049" self.env = LOCAL_ENV env_key = EnvPrivateKey("ZKSYNC_KEY1") - self.zksync = ZkSyncBuilder.build("http://127.0.0.1:15100") - self.eth_web3 = Web3(Web3.HTTPProvider("http://127.0.0.1:15045")) + self.zksync = ZkSyncBuilder.build("http://127.0.0.1:3050") + self.eth_web3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545")) self.account: LocalAccount = Account.from_key(env_key.key) self.wallet = Wallet(self.zksync, self.eth_web3, self.account) self.zksync_contract = self.eth_web3.eth.contract( diff --git a/zksync2/account/wallet_l1.py b/zksync2/account/wallet_l1.py index b0c5d86..e61d907 100644 --- a/zksync2/account/wallet_l1.py +++ b/zksync2/account/wallet_l1.py @@ -1147,7 +1147,8 @@ def finalize_withdrawal(self, withdraw_hash, index: int = 0): nonce=self._eth_web3.eth.get_transaction_count(self.address), ) - shared_bridge = self.get_l1_bridge_contracts().shared + shared_bridge_address = self._zksync_web3.zksync.zks_get_bridge_contracts().shared_l1_default_bridge + shared_bridge = self._eth_web3.eth.contract(address=shared_bridge_address, abi=l1_shared_bridge_abi_default()) tx = shared_bridge.functions.finalizeWithdrawal( self._zksync_web3.eth.chain_id, params["l1_batch_number"], diff --git a/zksync2/manage_contracts/utils.py b/zksync2/manage_contracts/utils.py index 9e726da..b311fc0 100644 --- a/zksync2/manage_contracts/utils.py +++ b/zksync2/manage_contracts/utils.py @@ -17,6 +17,8 @@ erc_20_abi_cache = None eth_token_abi_cache = None test_net_erc_20_abi_cache = None +l1_shared_bridge_abi_cache = None +bridgehub_abi_cache = None def zksync_abi_default(): @@ -85,25 +87,25 @@ def l1_bridge_abi_default(): def bridgehub_abi_default(): - global l1_bridge_abi_cache + global bridgehub_abi_cache - if l1_bridge_abi_cache is None: + if bridgehub_abi_cache is None: with pkg_resources.path(contract_abi, "IBridgehub.json") as p: with p.open(mode="r") as json_file: data = json.load(json_file) - l1_bridge_abi_cache = data["abi"] - return l1_bridge_abi_cache + bridgehub_abi_cache = data["abi"] + return bridgehub_abi_cache def l1_shared_bridge_abi_default(): - global l1_bridge_abi_cache + global l1_shared_bridge_abi_cache - if l1_bridge_abi_cache is None: + if l1_shared_bridge_abi_cache is None: with pkg_resources.path(contract_abi, "IL1SharedBridge.json") as p: with p.open(mode="r") as json_file: data = json.load(json_file) - l1_bridge_abi_cache = data["abi"] - return l1_bridge_abi_cache + l1_shared_bridge_abi_cache = data["abi"] + return l1_shared_bridge_abi_cache def eth_token_abi_default():