Skip to content

Commit

Permalink
♻️ Update revertTo and snapshot Cheat Codes (#139)
Browse files Browse the repository at this point in the history
### 🕓 Changelog

The Foundry PR [#8945](foundry-rs/foundry#8945)
introduced a renaming of the `snapshot` and `revertTo` cheat codes to
`snapshotState` and `revertToState`, respectively. This PR aligns our
test suite with the newly revised cheat codes.

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
  • Loading branch information
pcaversaccio authored Oct 3, 2024
1 parent 6f8dca5 commit 7c1b213
Show file tree
Hide file tree
Showing 17 changed files with 237 additions and 230 deletions.
18 changes: 9 additions & 9 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ CreateX_DeployCreate2AndInit_4Args_CustomiseRefundAddress_Public_Test:testFuzz_W
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(address,(uint256,uint256),bytes32,uint64,address) (runs: 256, μ: 1296972, ~: 1101045)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 812845782, ~: 1040431013)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(address,(uint256,uint256),bytes32,uint64,address) (runs: 256, μ: 1259766, ~: 1062896)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 67222, ~: 74384)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 855349, ~: 1003841)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 67225, ~: 74384)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 855352, ~: 1003861)
CreateX_DeployCreate2AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful((uint256,uint256),bytes32,uint64) (runs: 256, μ: 885611, ~: 1039108)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(address,(uint256,uint256),bytes32,uint64,address) (runs: 256, μ: 1303765, ~: 1120170)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 804717772, ~: 1040430992)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(address,(uint256,uint256),bytes32,uint64,address) (runs: 256, μ: 1251421, ~: 1063241)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 67079, ~: 74458)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 852262, ~: 1006034)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful((uint256,uint256),bytes32,uint64) (runs: 256, μ: 880343, ~: 1039215)
CreateX_DeployCreate2AndInit_5Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful((uint256,uint256),bytes32,uint64) (runs: 256, μ: 880340, ~: 1039215)
CreateX_DeployCreate2Clone_2Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractCreationFails(address,uint256,uint64) (runs: 256, μ: 1040431853, ~: 1040431826)
CreateX_DeployCreate2Clone_2Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractIsSuccessfullyCreatedAndWhenTheEIP1167MinimalProxyInitialisationCallIsSuccessful(address,uint256,uint64,address) (runs: 256, μ: 313899, ~: 313914)
CreateX_DeployCreate2Clone_2Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyInitialisationCallIsUnsuccessful(address,uint256,uint64) (runs: 256, μ: 93395, ~: 93407)
CreateX_DeployCreate2Clone_3Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractCreationFails(address,uint256,bytes32,uint64) (runs: 256, μ: 812845736, ~: 1040431216)
CreateX_DeployCreate2Clone_3Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractIsSuccessfullyCreatedAndWhenTheEIP1167MinimalProxyInitialisationCallIsSuccessful(address,uint256,bytes32,uint64,address) (runs: 256, μ: 149932, ~: 133519)
CreateX_DeployCreate2Clone_3Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractIsSuccessfullyCreatedAndWhenTheEIP1167MinimalProxyInitialisationCallIsSuccessful(address,uint256,bytes32,uint64,address) (runs: 256, μ: 150279, ~: 133519)
CreateX_DeployCreate2Clone_3Args_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyInitialisationCallIsUnsuccessful(address,uint256,bytes32,uint64) (runs: 256, μ: 78533, ~: 90920)
CreateX_DeployCreate2_1Arg_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,uint256) (runs: 256, μ: 1040431849, ~: 1040431833)
CreateX_DeployCreate2_1Arg_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLength(address,uint256,uint64,address) (runs: 256, μ: 2464648, ~: 2464564)
CreateX_DeployCreate2_1Arg_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,uint256) (runs: 256, μ: 70101, ~: 70346)
CreateX_DeployCreate2_2Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,bytes32,uint64,uint256) (runs: 256, μ: 820972318, ~: 1040431074)
CreateX_DeployCreate2_2Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLength(address,uint256,bytes32,uint64,address) (runs: 256, μ: 1215149, ~: 1026187)
CreateX_DeployCreate2_2Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,bytes32,uint64,uint256) (runs: 256, μ: 60246, ~: 67525)
CreateX_DeployCreate2_2Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,bytes32,uint64,uint256) (runs: 256, μ: 60243, ~: 67525)
CreateX_DeployCreate3AndInit_3Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(address,(uint256,uint256),uint64,address) (runs: 256, μ: 3159565, ~: 3159963)
CreateX_DeployCreate3AndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,(uint256,uint256)) (runs: 256, μ: 1024177407, ~: 1024177386)
CreateX_DeployCreate3AndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(address,(uint256,uint256),uint64,address) (runs: 256, μ: 3116447, ~: 3116988)
Expand All @@ -62,7 +62,7 @@ CreateX_DeployCreate3AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheIni
CreateX_DeployCreate3AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 106131, ~: 119235)
CreateX_DeployCreate3AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 890932, ~: 1057592)
CreateX_DeployCreate3AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheProxyContractCreationFails(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 796676618, ~: 1040440977)
CreateX_DeployCreate3AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful((uint256,uint256),bytes32,uint64) (runs: 256, μ: 926557, ~: 1092809)
CreateX_DeployCreate3AndInit_4Args_CustomiseSalt_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful((uint256,uint256),bytes32,uint64) (runs: 256, μ: 926554, ~: 1092809)
CreateX_DeployCreate3AndInit_5Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(address,(uint256,uint256),bytes32,uint64,address) (runs: 256, μ: 1403206, ~: 1234241)
CreateX_DeployCreate3AndInit_5Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,(uint256,uint256),bytes32,uint64) (runs: 256, μ: 788150567, ~: 1024176568)
CreateX_DeployCreate3AndInit_5Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(address,(uint256,uint256),bytes32,uint64,address) (runs: 256, μ: 1351221, ~: 1177314)
Expand Down Expand Up @@ -98,9 +98,9 @@ CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARun
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,uint256) (runs: 256, μ: 52672, ~: 53107)
CreateX_EfficientHash_Internal_Test:testFuzz_MatchesTheOutputOfAHighLevelHashAndShouldNeverRevert(bytes32,bytes32) (runs: 256, μ: 9167, ~: 9167)
CreateX_GenerateSalt_Internal_Test:testFuzz_NeverReverts(uint256) (runs: 256, μ: 19088, ~: 19088)
CreateX_GenerateSalt_Internal_Test:testFuzz_ShouldBeAFunctionOfMultipleBlockPropertiesAndTheCaller(uint256,address,string,uint64,address) (runs: 256, μ: 60592, ~: 60362)
CreateX_GenerateSalt_Internal_Test:testFuzz_ShouldBeAFunctionOfMultipleBlockPropertiesAndTheCaller(uint256,address,string,uint64,address) (runs: 256, μ: 60582, ~: 60362)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddress(address,bytes32) (runs: 256, μ: 33826, ~: 33827)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenTheSaltValueIsGeneratedPseudorandomly(address,uint256,address,string,uint64) (runs: 256, μ: 41555, ~: 41365)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltDoNotEqualTheCallerOrTheZeroAddressAndWhenTheSaltValueIsGeneratedPseudorandomly(address,uint256,address,string,uint64) (runs: 256, μ: 41590, ~: 41365)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x00(address,bytes32) (runs: 256, μ: 33276, ~: 33276)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltEquals0x01(address,bytes32) (runs: 256, μ: 33178, ~: 33178)
CreateX_Guard_Internal_Test:testFuzz_WhenTheFirst20BytesOfTheSaltEqualsTheCallerAndWhenThe21stByteOfTheSaltIsGreaterThan0x01(address,bytes32) (runs: 256, μ: 36039, ~: 35753)
Expand All @@ -124,6 +124,6 @@ CreateX_RequireSuccessfulContractCreation_2Args_Internal_Test:testFuzz_WhenTheNe
CreateX_RequireSuccessfulContractCreation_2Args_Internal_Test:testFuzz_WhenTheNewContractAddressHasNoCode(bool,address) (runs: 256, μ: 15653, ~: 15611)
CreateX_RequireSuccessfulContractCreation_2Args_Internal_Test:testFuzz_WhenTheSuccessBooleanIsFalse(address) (runs: 256, μ: 11407, ~: 11407)
CreateX_RequireSuccessfulContractCreation_2Args_Internal_Test:test_WhenTheNewContractAddressIsTheZeroAddress() (gas: 11267)
CreateX_RequireSuccessfulContractInitialisation_Internal_Test:testFuzz_WhenTheImplementationAddressHasCode(bytes,address) (runs: 256, μ: 14338, ~: 14283)
CreateX_RequireSuccessfulContractInitialisation_Internal_Test:testFuzz_WhenTheImplementationAddressHasCode(bytes,address) (runs: 256, μ: 14340, ~: 14283)
CreateX_RequireSuccessfulContractInitialisation_Internal_Test:testFuzz_WhenTheImplementationAddressHasNoCode(bytes,address) (runs: 256, μ: 17392, ~: 17225)
CreateX_RequireSuccessfulContractInitialisation_Internal_Test:testFuzz_WhenTheSuccessBooleanIsFalse(bytes,address) (runs: 256, μ: 13431, ~: 13235)
10 changes: 5 additions & 5 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@headlessui/react": "^2.1.8",
"@heroicons/react": "^2.1.5",
"next": "^14.2.13",
"next": "^14.2.14",
"next-themes": "^0.3.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
Expand All @@ -41,15 +41,15 @@
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@next/eslint-plugin-next": "^14.2.13",
"@next/eslint-plugin-next": "^14.2.14",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^22.7.4",
"@types/react": "^18.3.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.1",
"eslint-config-next": "^14.2.13",
"eslint-plugin-react": "^7.37.0",
"eslint-config-next": "^14.2.14",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"next-seo": "^6.6.0",
"postcss": "^8.4.47",
Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std
Submodule forge-std updated 2 files
+22 −7 src/Vm.sol
+1 −1 test/Vm.t.sol
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
Loading

0 comments on commit 7c1b213

Please sign in to comment.