Commit 5b9b3b8c authored by Maurelian's avatar Maurelian Committed by GitHub

Add permissioned game output assertions (#12093)

* test: Add permissioned game output assertions

* test: reorder DeployOpChainTest_Base for clarity

* Update packages/contracts-bedrock/test/DeployOPChain.t.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

---------
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>
parent 1ee7ea1f
...@@ -361,9 +361,10 @@ contract DeployOPChain_TestBase is Test { ...@@ -361,9 +361,10 @@ contract DeployOPChain_TestBase is Test {
}) })
); );
// Initialize deploy scripts. // Configure and deploy Superchain contracts
DeploySuperchain deploySuperchain = new DeploySuperchain(); DeploySuperchain deploySuperchain = new DeploySuperchain();
(DeploySuperchainInput dsi, DeploySuperchainOutput dso) = deploySuperchain.etchIOContracts(); (DeploySuperchainInput dsi, DeploySuperchainOutput dso) = deploySuperchain.etchIOContracts();
dsi.set(dsi.proxyAdminOwner.selector, proxyAdminOwner); dsi.set(dsi.proxyAdminOwner.selector, proxyAdminOwner);
dsi.set(dsi.protocolVersionsOwner.selector, protocolVersionsOwner); dsi.set(dsi.protocolVersionsOwner.selector, protocolVersionsOwner);
dsi.set(dsi.guardian.selector, guardian); dsi.set(dsi.guardian.selector, guardian);
...@@ -371,20 +372,16 @@ contract DeployOPChain_TestBase is Test { ...@@ -371,20 +372,16 @@ contract DeployOPChain_TestBase is Test {
dsi.set(dsi.requiredProtocolVersion.selector, requiredProtocolVersion); dsi.set(dsi.requiredProtocolVersion.selector, requiredProtocolVersion);
dsi.set(dsi.recommendedProtocolVersion.selector, recommendedProtocolVersion); dsi.set(dsi.recommendedProtocolVersion.selector, recommendedProtocolVersion);
DeployImplementations deployImplementations = createDeployImplementationsContract();
(DeployImplementationsInput dii, DeployImplementationsOutput dio) = deployImplementations.etchIOContracts();
deployOPChain = new DeployOPChain();
(doi, doo) = deployOPChain.etchIOContracts();
// Deploy the superchain contracts.
deploySuperchain.run(dsi, dso); deploySuperchain.run(dsi, dso);
// Populate the inputs for DeployImplementations based on the output of DeploySuperchain. // Populate the inputs for DeployImplementations based on the output of DeploySuperchain.
superchainConfigProxy = dso.superchainConfigProxy(); superchainConfigProxy = dso.superchainConfigProxy();
protocolVersionsProxy = dso.protocolVersionsProxy(); protocolVersionsProxy = dso.protocolVersionsProxy();
// Deploy the implementations. // Configure and deploy Implementation contracts
DeployImplementations deployImplementations = createDeployImplementationsContract();
(DeployImplementationsInput dii, DeployImplementationsOutput dio) = deployImplementations.etchIOContracts();
dii.set(dii.withdrawalDelaySeconds.selector, withdrawalDelaySeconds); dii.set(dii.withdrawalDelaySeconds.selector, withdrawalDelaySeconds);
dii.set(dii.minProposalSizeBytes.selector, minProposalSizeBytes); dii.set(dii.minProposalSizeBytes.selector, minProposalSizeBytes);
dii.set(dii.challengePeriodSeconds.selector, challengePeriodSeconds); dii.set(dii.challengePeriodSeconds.selector, challengePeriodSeconds);
...@@ -400,7 +397,11 @@ contract DeployOPChain_TestBase is Test { ...@@ -400,7 +397,11 @@ contract DeployOPChain_TestBase is Test {
dii.set(dii.standardVersionsToml.selector, standardVersionsToml); dii.set(dii.standardVersionsToml.selector, standardVersionsToml);
deployImplementations.run(dii, dio); deployImplementations.run(dii, dio);
// Set the OPStackManager input for DeployOPChain. // Deploy DeployOpChain, but defer populating the input values to the test suites inheriting this contract.
deployOPChain = new DeployOPChain();
(doi, doo) = deployOPChain.etchIOContracts();
// Set the OPStackManager address as input to DeployOPChain.
opsm = dio.opsmProxy(); opsm = dio.opsmProxy();
} }
...@@ -478,8 +479,12 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { ...@@ -478,8 +479,12 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
address batcherActual = address(uint160(uint256(doo.systemConfigProxy().batcherHash()))); address batcherActual = address(uint160(uint256(doo.systemConfigProxy().batcherHash())));
assertEq(batcherActual, batcher, "2300"); assertEq(batcherActual, batcher, "2300");
assertEq(address(doo.systemConfigProxy().unsafeBlockSigner()), unsafeBlockSigner, "2400"); assertEq(address(doo.systemConfigProxy().unsafeBlockSigner()), unsafeBlockSigner, "2400");
// assertEq(address(...proposer()), proposer, "2500"); // TODO once we deploy dispute games. assertEq(address(doo.permissionedDisputeGame().proposer()), proposer, "2500");
// assertEq(address(...challenger()), challenger, "2600"); // TODO once we deploy dispute games. assertEq(address(doo.permissionedDisputeGame().challenger()), challenger, "2600");
// TODO once we deploy the Permissionless Dispute Game
// assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700");
// assertEq(address(doo.faultDisputeGame().challenger()), challenger, "2800");
// Most architecture assertions are handled within the OP Stack Manager itself and therefore // Most architecture assertions are handled within the OP Stack Manager itself and therefore
// we only assert on the things that are not visible onchain. // we only assert on the things that are not visible onchain.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment