Skip to content

Commit

Permalink
♻️ Be more specific about the stopPrank statements
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Oct 7, 2023
1 parent 6a79108 commit caad200
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 50 deletions.
44 changes: 22 additions & 22 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(uint64) (runs: 256, μ: 2248556, ~: 2248529)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(uint256) (runs: 256, μ: 37683, ~: 37659)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(address,uint64) (runs: 256, μ: 2251514, ~: 2251530)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(address,uint256) (runs: 256, μ: 37818, ~: 37801)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheContractCreationFails(uint64,(uint256,uint256)) (runs: 256, μ: 63121, ~: 63219)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1084184, ~: 1084438)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1027414, ~: 1027910)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasAZeroLength(uint64,(uint256,uint256)) (runs: 256, μ: 65279, ~: 65377)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1005455, ~: 1006007)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1042205, ~: 1042653)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(uint64) (runs: 256, μ: 2248552, ~: 2248526)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(uint256) (runs: 256, μ: 37664, ~: 37659)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(address,uint64) (runs: 256, μ: 2251522, ~: 2251527)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(address,uint256) (runs: 256, μ: 37823, ~: 37801)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheContractCreationFails(uint64,(uint256,uint256)) (runs: 256, μ: 63117, ~: 63204)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1084185, ~: 1084411)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1027469, ~: 1027923)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasAZeroLength(uint64,(uint256,uint256)) (runs: 256, μ: 65251, ~: 65338)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1005515, ~: 1005965)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1042067, ~: 1042248)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheContractCreationFails(uint64,(uint256,uint256)) (runs: 256, μ: 61068, ~: 61164)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1085468, ~: 1085742)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1026384, ~: 1026755)
Expand All @@ -21,24 +21,24 @@ CreateX_DeployCreate_Public_Test:testFuzz_WhenTheContractCreationFails(uint64,ui
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasANonZeroLength(uint64,uint256) (runs: 256, μ: 1012164, ~: 1012165)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheCreatedRuntimeBytecodeHasAZeroLength(uint64,uint256) (runs: 256, μ: 55194, ~: 55172)
CreateX_EfficientHash_Internal_Test:test_Requirements(bytes32,bytes32) (runs: 256, μ: 5968, ~: 5968)
CreateX_GenerateSalt_Internal_Test:testFuzz_NeverReverts(uint256) (runs: 256, μ: 20311, ~: 20311)
CreateX_GenerateSalt_Internal_Test:test_ShouldBeAFunctionOfMultipleBlockPropertiesAndTheCaller() (gas: 51466)
CreateX_GenerateSalt_Internal_Test:testFuzz_NeverReverts(uint256) (runs: 256, μ: 20623, ~: 20623)
CreateX_GenerateSalt_Internal_Test:test_ShouldBeAFunctionOfMultipleBlockPropertiesAndTheCaller() (gas: 51805)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddress(address,bytes32) (runs: 256, μ: 32472, ~: 32473)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32545, ~: 32545)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 32485, ~: 32485)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 36037, ~: 35750)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32866, ~: 32944)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 33036, ~: 33036)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 36281, ~: 35979)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32539, ~: 32539)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 32479, ~: 32479)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 36040, ~: 35750)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32944, ~: 32944)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 33033, ~: 33033)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 36256, ~: 35979)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32838, ~: 32838)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 32796, ~: 32796)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 32585, ~: 32556)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 32582, ~: 32556)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32476, ~: 32476)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 32371, ~: 32371)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 32477, ~: 32200)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32732, ~: 32888)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 32480, ~: 32200)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 32810, ~: 32888)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 32830, ~: 32830)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 32884, ~: 32607)
CreateX_ParseSalt_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 32872, ~: 32607)
CreateX_RequireSuccessfulContractCreation_1Arg_Internal_Test:testFuzz_WhenTheNewContractAddressHasCode(address) (runs: 256, μ: 13459, ~: 13459)
CreateX_RequireSuccessfulContractCreation_1Arg_Internal_Test:testFuzz_WhenTheNewContractAddressHasNoCode(address) (runs: 256, μ: 15473, ~: 15473)
CreateX_RequireSuccessfulContractCreation_1Arg_Internal_Test:test_WhenTheNewContractAddressIsTheZeroAddress() (gas: 11099)
Expand Down
6 changes: 4 additions & 2 deletions test/internal/CreateX._generateSalt.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ contract CreateX_GenerateSalt_Internal_Test is BaseTest {
vm.revertTo(snapshotId);
assertEq(createXHarness.exposed_generateSalt(), originalSalt);

vm.prank(makeAddr("new sender"));
vm.startPrank(makeAddr("new sender"));
assertNotEq(originalSalt, createXHarness.exposed_generateSalt());
vm.stopPrank();
}

function testFuzz_NeverReverts(uint256 seed) external {
Expand All @@ -94,9 +95,10 @@ contract CreateX_GenerateSalt_Internal_Test is BaseTest {
vm.warp(bound(entropy3, block.timestamp, 52e4 weeks));
vm.prevrandao(bytes32(entropy4));
vm.chainId(bound(entropy5, 0, type(uint64).max));
vm.prank(address(uint160(entropy6)));

// Third, we verify that it doesn't revert by calling it.
vm.startPrank(address(uint160(entropy6)));
createXHarness.exposed_generateSalt();
vm.stopPrank();
}
}
10 changes: 5 additions & 5 deletions test/internal/CreateX._guard.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ contract CreateX_Guard_Internal_Test is BaseTest {
vm.startPrank(caller);
// It should return the `keccak256` hash of the ABI-encoded values `msg.sender`, `block.chainid`, and the `salt`.
bytes32 guardedSalt = createXHarness.exposed_guard(cachedSalt);
assertEq(guardedSalt, keccak256(abi.encode(caller, block.chainid, cachedSalt)));
vm.stopPrank();
assertEq(guardedSalt, keccak256(abi.encode(caller, block.chainid, cachedSalt)));
}

/**
Expand All @@ -61,8 +61,8 @@ contract CreateX_Guard_Internal_Test is BaseTest {
vm.startPrank(caller);
// It should return the `keccak256` hash of the ABI-encoded values `msg.sender` and the `salt`.
bytes32 guardedSalt = createXHarness.exposed_guard(cachedSalt);
assertEq(guardedSalt, keccak256(abi.encode(caller, cachedSalt)));
vm.stopPrank();
assertEq(guardedSalt, keccak256(abi.encode(caller, cachedSalt)));
}

/**
Expand Down Expand Up @@ -108,8 +108,8 @@ contract CreateX_Guard_Internal_Test is BaseTest {
vm.startPrank(caller);
// It should return the `keccak256` hash of the ABI-encoded values `block.chainid` and the `salt`.
bytes32 guardedSalt = createXHarness.exposed_guard(cachedSalt);
assertEq(guardedSalt, keccak256(abi.encode(block.chainid, cachedSalt)));
vm.stopPrank();
assertEq(guardedSalt, keccak256(abi.encode(block.chainid, cachedSalt)));
}

function testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(
Expand All @@ -120,8 +120,8 @@ contract CreateX_Guard_Internal_Test is BaseTest {
vm.startPrank(caller);
// It should return the unmodified salt value.
bytes32 guardedSalt = createXHarness.exposed_guard(cachedSalt);
assertEq(guardedSalt, cachedSalt);
vm.stopPrank();
assertEq(guardedSalt, cachedSalt);
}

function testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(
Expand Down Expand Up @@ -149,7 +149,7 @@ contract CreateX_Guard_Internal_Test is BaseTest {
vm.startPrank(caller);
// It should return the unmodified salt value.
bytes32 guardedSalt = createXHarness.exposed_guard(cachedSalt);
assertEq(guardedSalt, cachedSalt);
vm.stopPrank();
assertEq(guardedSalt, cachedSalt);
}
}
18 changes: 9 additions & 9 deletions test/internal/CreateX._parseSalt.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.True` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.MsgSender);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.True);
vm.stopPrank();
}

/**
Expand All @@ -100,9 +100,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.False` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.MsgSender);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.False);
vm.stopPrank();
}

/**
Expand Down Expand Up @@ -131,9 +131,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.Unspecified` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.MsgSender);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.Unspecified);
vm.stopPrank();
}

modifier whenTheFirst20BytesOfTheSaltEqualsTheZeroAddress(bytes32 salt) {
Expand All @@ -152,9 +152,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.True` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.ZeroAddress);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.True);
vm.stopPrank();
}

function testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(
Expand All @@ -167,9 +167,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.False` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.ZeroAddress);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.False);
vm.stopPrank();
}

function testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(
Expand All @@ -182,9 +182,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.Unspecified` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.ZeroAddress);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.Unspecified);
vm.stopPrank();
}

modifier whenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddress(address caller, bytes32 salt) {
Expand All @@ -206,9 +206,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.True` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.Random);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.True);
vm.stopPrank();
}

function testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenThe21stByteOfTheSaltEquals0x00(
Expand All @@ -224,9 +224,9 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.False` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.Random);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.False);
vm.stopPrank();
}

function testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(
Expand All @@ -242,8 +242,8 @@ contract CreateX_ParseSalt_Internal_Test is BaseTest {
// It should return the `RedeployProtectionFlag.Unspecified` `enum` as second return value.
(CreateX.SenderBytes senderBytes, CreateX.RedeployProtectionFlag redeployProtectionFlag) = createXHarness
.exposed_parseSalt(cachedSalt);
vm.stopPrank();
assertEq(senderBytes, CreateX.SenderBytes.Random);
assertEq(redeployProtectionFlag, CreateX.RedeployProtectionFlag.Unspecified);
vm.stopPrank();
}
}
2 changes: 1 addition & 1 deletion test/public/CreateX.computeCreateAddress_1Arg.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ contract CreateX_ComputeCreateAddress_1Arg_Public_Test is BaseTest {
) external whenTheNonceValueDoesNotExceed18446744073709551614(nonce) {
vm.startPrank(createXAddr);
address createAddressComputedOnChain = address(new CreateX());
vm.stopPrank();
// It returns the 20-byte address where a contract will be stored.
assertEq(createX.computeCreateAddress(nonce), createAddressComputedOnChain);
vm.stopPrank();
}

modifier whenTheNonceValueExceeds18446744073709551614(uint256 nonce) {
Expand Down
2 changes: 1 addition & 1 deletion test/public/CreateX.computeCreateAddress_2Args.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ contract CreateX_ComputeCreateAddress_2Args_Public_Test is BaseTest {
) external whenTheNonceValueDoesNotExceed18446744073709551614(deployer, nonce) {
vm.startPrank(deployer);
address createAddressComputedOnChain = address(new CreateX());
vm.stopPrank();
// It returns the 20-byte address where a contract will be stored.
assertEq(createX.computeCreateAddress(deployer, nonce), createAddressComputedOnChain);
vm.stopPrank();
}

modifier whenTheNonceValueExceeds18446744073709551614(uint256 nonce) {
Expand Down
Loading

0 comments on commit caad200

Please sign in to comment.