Commit c8edbe24 authored by Maurelian's avatar Maurelian Committed by GitHub

test: Remove exceptions for unlabelled fdg contracts (#12462)

* test: Remove exceptions for unlabelled fdg contracts

* fix: Unused import
parent 34e8e691
...@@ -216,13 +216,6 @@ abstract contract Artifacts { ...@@ -216,13 +216,6 @@ abstract contract Artifacts {
/// @notice Returns the value of the internal `_initialized` storage slot for a given contract. /// @notice Returns the value of the internal `_initialized` storage slot for a given contract.
function loadInitializedSlot(string memory _contractName) public returns (uint8 initialized_) { function loadInitializedSlot(string memory _contractName) public returns (uint8 initialized_) {
// FaultDisputeGame and PermissionedDisputeGame are initializable but cannot be loaded with
// this function yet because they are not properly labeled in the deploy script.
// TODO: Remove this restriction once the deploy script is fixed.
if (LibString.eq(_contractName, "FaultDisputeGame") || LibString.eq(_contractName, "PermissionedDisputeGame")) {
revert UnsupportedInitializableContract(_contractName);
}
address contractAddress; address contractAddress;
// Check if the contract name ends with `Proxy` and, if so, get the implementation address // Check if the contract name ends with `Proxy` and, if so, get the implementation address
if (LibString.endsWith(_contractName, "Proxy")) { if (LibString.endsWith(_contractName, "Proxy")) {
......
...@@ -6,7 +6,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol"; ...@@ -6,7 +6,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol";
// Scripts // Scripts
import { Executables } from "scripts/libraries/Executables.sol"; import { Executables } from "scripts/libraries/Executables.sol";
import { ForgeArtifacts, StorageSlot } from "scripts/libraries/ForgeArtifacts.sol"; import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol";
import { Process } from "scripts/libraries/Process.sol"; import { Process } from "scripts/libraries/Process.sol";
// Libraries // Libraries
...@@ -473,19 +473,9 @@ contract Initializer_Test is Bridge_Initializer { ...@@ -473,19 +473,9 @@ contract Initializer_Test is Bridge_Initializer {
InitializeableContract memory _contract = contracts[i]; InitializeableContract memory _contract = contracts[i];
string memory name = _getRealContractName(_contract.name); string memory name = _getRealContractName(_contract.name);
// Grab the value of the "initialized" storage slot. Must handle special case for the // Grab the value of the "initialized" storage slot.
// FaultDisputeGame and PermissionedDisputeGame contracts since these have a different
// name for the "initialized" storage slot and are currently not properly labeled in
// the deployment script.
// TODO: Update deployment script to properly label the dispute game contracts.
uint8 initializedSlotVal; uint8 initializedSlotVal;
if (LibString.eq(name, "FaultDisputeGame") || LibString.eq(name, "PermissionedDisputeGame")) { initializedSlotVal = deploy.loadInitializedSlot(name);
StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(name);
bytes32 slotVal = vm.load(_contract.target, bytes32(vm.parseUint(slot.slot)));
initializedSlotVal = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF);
} else {
initializedSlotVal = deploy.loadInitializedSlot(name);
}
// Assert that the contract is already initialized. // Assert that the contract is already initialized.
assertTrue( assertTrue(
......
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