Skip to content

Commit

Permalink
test: reorder DeployOpChainTest_Base for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian committed Sep 24, 2024
1 parent 89e9a82 commit 58b1cd4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/contracts-bedrock/test/DeployOPChain.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -361,30 +361,27 @@ contract DeployOPChain_TestBase is Test {
})
);

// Initialize deploy scripts.
// Configure and deploy Superchain contracts
DeploySuperchain deploySuperchain = new DeploySuperchain();
(DeploySuperchainInput dsi, DeploySuperchainOutput dso) = deploySuperchain.etchIOContracts();

dsi.set(dsi.proxyAdminOwner.selector, proxyAdminOwner);
dsi.set(dsi.protocolVersionsOwner.selector, protocolVersionsOwner);
dsi.set(dsi.guardian.selector, guardian);
dsi.set(dsi.paused.selector, paused);
dsi.set(dsi.requiredProtocolVersion.selector, requiredProtocolVersion);
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);

// Populate the inputs for DeployImplementations based on the output of DeploySuperchain.
superchainConfigProxy = dso.superchainConfigProxy();
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.minProposalSizeBytes.selector, minProposalSizeBytes);
dii.set(dii.challengePeriodSeconds.selector, challengePeriodSeconds);
Expand All @@ -393,8 +390,13 @@ contract DeployOPChain_TestBase is Test {
dii.set(dii.release.selector, release);
dii.set(dii.superchainConfigProxy.selector, address(superchainConfigProxy));
dii.set(dii.protocolVersionsProxy.selector, address(protocolVersionsProxy));

deployImplementations.run(dii, dio);

// 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 input for DeployOPChain.
opsm = dio.opsmProxy();
}
Expand Down

0 comments on commit 58b1cd4

Please sign in to comment.