Skip to content

Commit 0a14f50

Browse files
committed
opcm: Assert actual chain ID
1 parent 1cd588a commit 0a14f50

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/contracts-bedrock/test/L1/OPContractsManager.t.sol

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,21 @@ abstract contract OPContractsManager_TestInit is CommonTest, DisputeGames {
428428
address proposer;
429429
address challenger;
430430

431+
uint256 chain1L2ChainId;
432+
uint256 chain2L2ChainId;
433+
431434
IOPContractsManager.DeployOutput internal chainDeployOutput1;
432435
IOPContractsManager.DeployOutput internal chainDeployOutput2;
433436

434437
function setUp() public virtual override {
435438
super.setUp();
436439
proposer = address(this);
437440
challenger = address(this);
441+
chain1L2ChainId = 100;
442+
chain2L2ChainId = 101;
438443

439-
chainDeployOutput1 = createChainContracts(100);
440-
chainDeployOutput2 = createChainContracts(101);
444+
chainDeployOutput1 = createChainContracts(chain1L2ChainId);
445+
chainDeployOutput2 = createChainContracts(chain2L2ChainId);
441446

442447
vm.deal(address(chainDeployOutput1.ethLockboxProxy), 100 ether);
443448
vm.deal(address(chainDeployOutput2.ethLockboxProxy), 100 ether);
@@ -604,7 +609,7 @@ contract OPContractsManager_AddGameType_Test is OPContractsManager_TestInit {
604609
assertEq(newPDG.challenger(), challenger, "challenger mismatch");
605610

606611
// L2 chain ID call should not revert because this is not a Super game.
607-
assertNotEq(newPDG.l2ChainId(), 0, "l2ChainId should not be zero");
612+
assertEq(newPDG.l2ChainId(), chain1L2ChainId, "l2ChainId should be set correctly");
608613

609614
if (isDevFeatureEnabled(DevFeatures.DEPLOY_V2_DISPUTE_GAMES)) {
610615
// Get the v2 implementation address from OPCM
@@ -647,7 +652,7 @@ contract OPContractsManager_AddGameType_Test is OPContractsManager_TestInit {
647652
notPDG.proposer();
648653

649654
// L2 chain ID call should not revert because this is not a Super game.
650-
assertNotEq(notPDG.l2ChainId(), 0, "l2ChainId should not be zero");
655+
assertEq(notPDG.l2ChainId(), chain1L2ChainId, "l2ChainId should be set correctly");
651656

652657
// Verify v2 implementation is registered in DisputeGameFactory
653658
address registeredImpl = address(chainDeployOutput1.disputeGameFactoryProxy.gameImpls(input.disputeGameType));

0 commit comments

Comments
 (0)