From 2b284690e5f10b2b4bfd1cc20bcd1f3de864d25b Mon Sep 17 00:00:00 2001 From: AgusDuha <81362284+agusduha@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:23:50 -0300 Subject: [PATCH] test: add L2 standard bridge interop unit tests (#13) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: unit tests fixes * fix: super to legacy tests failing * fix: mock and expect mint and burn --- packages/contracts-bedrock/src/libraries/Predeploys.sol | 2 +- .../contracts-bedrock/test/vendor/Initializable.t.sol | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/contracts-bedrock/src/libraries/Predeploys.sol b/packages/contracts-bedrock/src/libraries/Predeploys.sol index 9dcd7f0a95d0..d25d28face68 100644 --- a/packages/contracts-bedrock/src/libraries/Predeploys.sol +++ b/packages/contracts-bedrock/src/libraries/Predeploys.sol @@ -108,7 +108,7 @@ library Predeploys { if (_addr == WETH) return "WETH"; if (_addr == L2_CROSS_DOMAIN_MESSENGER) return "L2CrossDomainMessenger"; if (_addr == GAS_PRICE_ORACLE) return "GasPriceOracle"; - if (_addr == L2_STANDARD_BRIDGE) return "L2StandardBridge"; + if (_addr == L2_STANDARD_BRIDGE) return "L2StandardBridgeInterop"; if (_addr == SEQUENCER_FEE_WALLET) return "SequencerFeeVault"; if (_addr == OPTIMISM_MINTABLE_ERC20_FACTORY) return "OptimismMintableERC20Factory"; if (_addr == L1_BLOCK_NUMBER) return "L1BlockNumber"; diff --git a/packages/contracts-bedrock/test/vendor/Initializable.t.sol b/packages/contracts-bedrock/test/vendor/Initializable.t.sol index df9231a27627..45fe8751b4d0 100644 --- a/packages/contracts-bedrock/test/vendor/Initializable.t.sol +++ b/packages/contracts-bedrock/test/vendor/Initializable.t.sol @@ -307,6 +307,14 @@ contract Initializer_Test is Bridge_Initializer { initCalldata: abi.encodeCall(l2StandardBridge.initialize, (StandardBridge(payable(l1StandardBridge)))) }) ); + // L2StandardBridgeInterop + contracts.push( + InitializeableContract({ + target: address(l2StandardBridge), + initCalldata: abi.encodeCall(l2StandardBridge.initialize, (l1StandardBridge)), + initializedSlotVal: deploy.loadInitializedSlot("L2StandardBridgeInterop") + }) + ); // L1ERC721BridgeImpl contracts.push( InitializeableContract({