Commit 144a7750 authored by Matt Solomon's avatar Matt Solomon Committed by GitHub

test: fix test and variable naming conventions (#11845)

parent 84b1cde3
...@@ -292,39 +292,39 @@ contract DeployOPChainOutput { ...@@ -292,39 +292,39 @@ contract DeployOPChainOutput {
contract DeployOPChain is Script { contract DeployOPChain is Script {
// -------- Core Deployment Methods -------- // -------- Core Deployment Methods --------
function run(string memory _infile) public { function run(string memory _infile) public {
(DeployOPChainInput dsi, DeployOPChainOutput dso) = etchIOContracts(); (DeployOPChainInput doi, DeployOPChainOutput doo) = etchIOContracts();
dsi.loadInputFile(_infile); doi.loadInputFile(_infile);
run(dsi, dso); run(doi, doo);
string memory outfile = ""; // This will be derived from input file name, e.g. `foo.in.toml` -> `foo.out.toml` string memory outfile = ""; // This will be derived from input file name, e.g. `foo.in.toml` -> `foo.out.toml`
dso.writeOutputFile(outfile); doo.writeOutputFile(outfile);
require(false, "DeployOPChain: run is not implemented"); require(false, "DeployOPChain: run is not implemented");
} }
function run(DeployOPChainInput.Input memory _input) public returns (DeployOPChainOutput.Output memory) { function run(DeployOPChainInput.Input memory _input) public returns (DeployOPChainOutput.Output memory) {
(DeployOPChainInput dsi, DeployOPChainOutput dso) = etchIOContracts(); (DeployOPChainInput doi, DeployOPChainOutput doo) = etchIOContracts();
dsi.loadInput(_input); doi.loadInput(_input);
run(dsi, dso); run(doi, doo);
return dso.output(); return doo.output();
} }
function run(DeployOPChainInput _dsi, DeployOPChainOutput _dso) public { function run(DeployOPChainInput _doi, DeployOPChainOutput _doo) public {
require(_dsi.inputSet(), "DeployOPChain: input not set"); require(_doi.inputSet(), "DeployOPChain: input not set");
OPStackManager opsm = _dsi.opsm(); OPStackManager opsm = _doi.opsm();
OPStackManager.Roles memory roles = OPStackManager.Roles({ OPStackManager.Roles memory roles = OPStackManager.Roles({
opChainProxyAdminOwner: _dsi.opChainProxyAdminOwner(), opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _dsi.systemConfigOwner(), systemConfigOwner: _doi.systemConfigOwner(),
batcher: _dsi.batcher(), batcher: _doi.batcher(),
unsafeBlockSigner: _dsi.unsafeBlockSigner(), unsafeBlockSigner: _doi.unsafeBlockSigner(),
proposer: _dsi.proposer(), proposer: _doi.proposer(),
challenger: _dsi.challenger() challenger: _doi.challenger()
}); });
OPStackManager.DeployInput memory deployInput = OPStackManager.DeployInput({ OPStackManager.DeployInput memory deployInput = OPStackManager.DeployInput({
roles: roles, roles: roles,
basefeeScalar: _dsi.basefeeScalar(), basefeeScalar: _doi.basefeeScalar(),
blobBasefeeScalar: _dsi.blobBaseFeeScalar(), blobBasefeeScalar: _doi.blobBaseFeeScalar(),
l2ChainId: _dsi.l2ChainId() l2ChainId: _doi.l2ChainId()
}); });
vm.broadcast(msg.sender); vm.broadcast(msg.sender);
...@@ -347,40 +347,40 @@ contract DeployOPChain is Script { ...@@ -347,40 +347,40 @@ contract DeployOPChain is Script {
vm.label(address(deployOutput.delayedWETHPermissionedGameProxy), "delayedWETHPermissionedGameProxy"); vm.label(address(deployOutput.delayedWETHPermissionedGameProxy), "delayedWETHPermissionedGameProxy");
vm.label(address(deployOutput.delayedWETHPermissionlessGameProxy), "delayedWETHPermissionlessGameProxy"); vm.label(address(deployOutput.delayedWETHPermissionlessGameProxy), "delayedWETHPermissionlessGameProxy");
_dso.set(_dso.opChainProxyAdmin.selector, address(deployOutput.opChainProxyAdmin)); _doo.set(_doo.opChainProxyAdmin.selector, address(deployOutput.opChainProxyAdmin));
_dso.set(_dso.addressManager.selector, address(deployOutput.addressManager)); _doo.set(_doo.addressManager.selector, address(deployOutput.addressManager));
_dso.set(_dso.l1ERC721BridgeProxy.selector, address(deployOutput.l1ERC721BridgeProxy)); _doo.set(_doo.l1ERC721BridgeProxy.selector, address(deployOutput.l1ERC721BridgeProxy));
_dso.set(_dso.systemConfigProxy.selector, address(deployOutput.systemConfigProxy)); _doo.set(_doo.systemConfigProxy.selector, address(deployOutput.systemConfigProxy));
_dso.set( _doo.set(
_dso.optimismMintableERC20FactoryProxy.selector, address(deployOutput.optimismMintableERC20FactoryProxy) _doo.optimismMintableERC20FactoryProxy.selector, address(deployOutput.optimismMintableERC20FactoryProxy)
); );
_dso.set(_dso.l1StandardBridgeProxy.selector, address(deployOutput.l1StandardBridgeProxy)); _doo.set(_doo.l1StandardBridgeProxy.selector, address(deployOutput.l1StandardBridgeProxy));
_dso.set(_dso.l1CrossDomainMessengerProxy.selector, address(deployOutput.l1CrossDomainMessengerProxy)); _doo.set(_doo.l1CrossDomainMessengerProxy.selector, address(deployOutput.l1CrossDomainMessengerProxy));
_dso.set(_dso.optimismPortalProxy.selector, address(deployOutput.optimismPortalProxy)); _doo.set(_doo.optimismPortalProxy.selector, address(deployOutput.optimismPortalProxy));
_dso.set(_dso.disputeGameFactoryProxy.selector, address(deployOutput.disputeGameFactoryProxy)); _doo.set(_doo.disputeGameFactoryProxy.selector, address(deployOutput.disputeGameFactoryProxy));
_dso.set(_dso.disputeGameFactoryImpl.selector, address(deployOutput.disputeGameFactoryImpl)); _doo.set(_doo.disputeGameFactoryImpl.selector, address(deployOutput.disputeGameFactoryImpl));
_dso.set(_dso.anchorStateRegistryProxy.selector, address(deployOutput.anchorStateRegistryProxy)); _doo.set(_doo.anchorStateRegistryProxy.selector, address(deployOutput.anchorStateRegistryProxy));
_dso.set(_dso.anchorStateRegistryImpl.selector, address(deployOutput.anchorStateRegistryImpl)); _doo.set(_doo.anchorStateRegistryImpl.selector, address(deployOutput.anchorStateRegistryImpl));
_dso.set(_dso.faultDisputeGame.selector, address(deployOutput.faultDisputeGame)); _doo.set(_doo.faultDisputeGame.selector, address(deployOutput.faultDisputeGame));
_dso.set(_dso.permissionedDisputeGame.selector, address(deployOutput.permissionedDisputeGame)); _doo.set(_doo.permissionedDisputeGame.selector, address(deployOutput.permissionedDisputeGame));
_dso.set(_dso.delayedWETHPermissionedGameProxy.selector, address(deployOutput.delayedWETHPermissionedGameProxy)); _doo.set(_doo.delayedWETHPermissionedGameProxy.selector, address(deployOutput.delayedWETHPermissionedGameProxy));
_dso.set( _doo.set(
_dso.delayedWETHPermissionlessGameProxy.selector, address(deployOutput.delayedWETHPermissionlessGameProxy) _doo.delayedWETHPermissionlessGameProxy.selector, address(deployOutput.delayedWETHPermissionlessGameProxy)
); );
_dso.checkOutput(); _doo.checkOutput();
} }
// -------- Utilities -------- // -------- Utilities --------
function etchIOContracts() internal returns (DeployOPChainInput dsi_, DeployOPChainOutput dso_) { function etchIOContracts() internal returns (DeployOPChainInput doi_, DeployOPChainOutput doo_) {
(dsi_, dso_) = getIOContracts(); (doi_, doo_) = getIOContracts();
vm.etch(address(dsi_), type(DeployOPChainInput).runtimeCode); vm.etch(address(doi_), type(DeployOPChainInput).runtimeCode);
vm.etch(address(dso_), type(DeployOPChainOutput).runtimeCode); vm.etch(address(doo_), type(DeployOPChainOutput).runtimeCode);
} }
function getIOContracts() public view returns (DeployOPChainInput dsi_, DeployOPChainOutput dso_) { function getIOContracts() public view returns (DeployOPChainInput doi_, DeployOPChainOutput doo_) {
dsi_ = DeployOPChainInput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainInput")); doi_ = DeployOPChainInput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainInput"));
dso_ = DeployOPChainOutput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainOutput")); doo_ = DeployOPChainOutput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainOutput"));
} }
} }
...@@ -56,7 +56,15 @@ import { Solarray } from "scripts/libraries/Solarray.sol"; ...@@ -56,7 +56,15 @@ import { Solarray } from "scripts/libraries/Solarray.sol";
// documentation. // documentation.
// //
// Additionally, we intentionally use "Input" and "Output" terminology to clearly distinguish these // Additionally, we intentionally use "Input" and "Output" terminology to clearly distinguish these
// scripts from the existing ones that use the "Config" and "Artifacts" terminology. // scripts from the existing ones that use the "Config" and "Artifacts" terminology. Within scripts
// we use variable names that are shorthand for the full contract names, for example:
// - `dsi` for DeploySuperchainInput
// - `dso` for DeploySuperchainOutput
// - `dio` for DeployImplementationsInput
// - `dio` for DeployImplementationsOutput
// - `doo` for DeployOPChainInput
// - `doo` for DeployOPChainOutput
// - etc.
contract DeploySuperchainInput is CommonBase { contract DeploySuperchainInput is CommonBase {
using stdToml for string; using stdToml for string;
......
...@@ -206,7 +206,7 @@ contract DeploySuperchain_Test is Test { ...@@ -206,7 +206,7 @@ contract DeploySuperchain_Test is Test {
return keccak256(abi.encode(_seed, _i)); return keccak256(abi.encode(_seed, _i));
} }
function test_run_memory_succeeds(bytes32 _seed) public { function testFuzz_run_memory_succeeds(bytes32 _seed) public {
// Generate random input values from the seed. This doesn't give us the benefit of the forge // Generate random input values from the seed. This doesn't give us the benefit of the forge
// fuzzer's dictionary, but that's ok because we are just testing that values are set and // fuzzer's dictionary, but that's ok because we are just testing that values are set and
// passed correctly. // passed correctly.
......
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