Skip to content

Commit

Permalink
contracts-bedrock: move reinitialization test to Initializable.t.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfuturistic committed Jan 3, 2024
1 parent 4b4a398 commit 95434e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ contract OptimismMintableTokenFactory_Test is Bridge_Initializer {
assertEq(address(l1OptimismMintableERC20Factory.bridge()), address(l1StandardBridge));
}

/// @dev Tests that the proxy cannot be initialized twice.
function test_initialize_cannotInitProxy_reverts() external {
vm.expectRevert("Initializable: contract is already initialized");
l1OptimismMintableERC20Factory.initialize(address(0));
}

/// @dev Tests that the implementation cannot be initialized twice.
function test_initialize_cannotInitImpl_reverts() external {
address impl = deploy.mustGetAddress("OptimismMintableERC20Factory");
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts-bedrock/test/vendor/Initializable.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ contract Initializer_Test is Bridge_Initializer {
initializedSlotVal: deploy.loadInitializedSlot("L2ERC721Bridge", false)
})
);
// OptimismMintableERC20Factory
contracts.push(
InitializeableContract({
target: address(l1OptimismMintableERC20Factory),
initCalldata: abi.encodeCall(l1OptimismMintableERC20Factory.initialize, (address(l1StandardBridge))),
initializedSlotVal: deploy.loadInitializedSlot("OptimismMintableERC20Factory", false)
})
);
}

/// @notice Tests that:
Expand Down

0 comments on commit 95434e0

Please sign in to comment.