From b854ed39b29f771204bbeee36e43d5546c6f53bb Mon Sep 17 00:00:00 2001 From: Benjamin Bollen Date: Tue, 26 Mar 2024 20:45:20 +0000 Subject: [PATCH] (test): neither create2 or create work in the test setting; revert and instead mock to set addresses later than constructor --- test/hub/V1MintStatusUpdate.t.sol | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/test/hub/V1MintStatusUpdate.t.sol b/test/hub/V1MintStatusUpdate.t.sol index f337584..1c5b4f9 100644 --- a/test/hub/V1MintStatusUpdate.t.sol +++ b/test/hub/V1MintStatusUpdate.t.sol @@ -3,15 +3,23 @@ pragma solidity >=0.8.13; import {Test} from "forge-std/Test.sol"; import {StdCheats} from "forge-std/StdCheats.sol"; +import "../../src/migration/Migration.sol"; import "../setup/TimeCirclesSetup.sol"; import "../setup/HumanRegistration.sol"; import "../migration/MockHub.sol"; import "./MockMigrationHub.sol"; contract V1MintStatusUpdateTest is Test, TimeCirclesSetup, HumanRegistration { + // Constants + + bytes32 private constant SALT = keccak256("CirclesV2:V1MintStatusUpdateTest"); + // State variables MockMigrationHub public mockHub; + MockHubV1 public mockHubV1; + + Migration public migration; // Constructor @@ -21,9 +29,23 @@ contract V1MintStatusUpdateTest is Test, TimeCirclesSetup, HumanRegistration { function setUp() public { startTime(); + + mockHubV1 = new MockHubV1(); + migration = new Migration(address(mockHubV1), address(1), INFLATION_DAY_ZERO, 365 days); + mockHub = new MockMigrationHub(mockHubV1, address(2), INFLATION_DAY_ZERO, 365 days); + } // Tests - function testMigrationFromV1DuringBootstrap() public {} + function testMigrationFromV1DuringBootstrap() public { + + } + + // Private functions + + function _calculateContractAddress(address _deployer, uint256 _nonce) private returns (address) { + // predict the contract addresses + bytes memory input = abi.encodePacked(bytes1(0xd6), bytes1(0x94), _deployer, _nonce); + } }