Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed May 9, 2023
1 parent fc15d8c commit ef1c54c
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion packages/protocol/test/genesis/GenerateGenesis.g.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ contract TestGenerateGenesis is Test, AddressResolver {
string.concat(vm.projectRoot(), "/deployments/genesis_alloc.json")
);
address private owner = configJSON.readAddress(".contractOwner");
address private admin = configJSON.readAddress(".contractOwner");

uint64 public constant BLOCK_GAS_LIMIT = 30000000;

function testContractDeployment() public {
Expand All @@ -46,12 +48,22 @@ contract TestGenerateGenesis is Test, AddressResolver {
checkDeployedCode("ProxiedSignalService");

// check proxies
checkDeployedCode("TaikoL1Proxy");
checkDeployedCode("TaikoL2Proxy");
checkDeployedCode("TokenVaultProxy");
checkDeployedCode("EtherVaultProxy");
checkDeployedCode("BridgeProxy");
checkDeployedCode("AddressManagerProxy");
checkDeployedCode("SignalServiceProxy");

checkProxyImplementation("TaikoL2Proxy", "ProxiedTaikoL2");
checkProxyImplementation("TokenVaultProxy", "ProxiedTokenVault");
checkProxyImplementation("EtherVaultProxy", "ProxiedEtherVault");
checkProxyImplementation("BridgeProxy", "ProxiedBridge");
checkProxyImplementation(
"AddressManagerProxy",
"ProxiedAddressManager"
);
checkProxyImplementation("SignalServiceProxy", "ProxiedSignalService");
}

function testAddressManager() public {
Expand Down Expand Up @@ -210,6 +222,23 @@ contract TestGenerateGenesis is Test, AddressResolver {
assertEq(address(contractAddress).code, vm.parseBytes(deployedCode));
}

function checkProxyImplementation(
string memory proxyName,
string memory contractName
) private {
address contractAddress = getPredeployedContractAddress(contractName);
address proxyAddress = getPredeployedContractAddress(proxyName);
assertEq(
TransparentUpgradeableProxy(payable(proxyAddress)).implementation(),
address(contractAddress)
);

assertEq(
TransparentUpgradeableProxy(payable(proxyAddress)).admin(),
owner
);
}

function checkSavedAddress(
AddressManager addressManager,
string memory contractName,
Expand Down

0 comments on commit ef1c54c

Please sign in to comment.