Browse Source

ethereum: Fix flaky governance replay attack test (#3555)

Dirk Brink 2 years ago
parent
commit
a2022c77e1
1 changed files with 5 additions and 1 deletions
  1. 5 1
      ethereum/forge-test/Governance.t.sol

+ 5 - 1
ethereum/forge-test/Governance.t.sol

@@ -290,9 +290,13 @@ contract TestGovernance is TestUtils {
         public
         unchangedStorage(address(proxied), storageSlot)
     {
+        MyImplementation newImpl = new MyImplementation(EVMCHAINID, CHAINID);
+
+        vm.assume(storageSlot != IMPLEMENTATION_SLOT);
+        vm.assume(storageSlot != hashedLocation(address(newImpl), INIT_IMPLEMENTATION_SLOT));
+
         vm.chainId(EVMCHAINID);
 
-        MyImplementation newImpl = new MyImplementation(EVMCHAINID, CHAINID);
         bytes memory payload = payloadSubmitContract(MODULE, CHAINID, address(newImpl));
         (bytes memory _vm, bytes32 hash) = validVm(
             0, timestamp, nonce, 1, governanceContract, sequence, consistencyLevel, payload, testGuardian);