Skip to content

Commit 5b70c1c

Browse files
authored
chore: rm state cheatcodes (#29)
* chore: rm state cheatcodes * chore: rm dangling vm.state references
1 parent edd667c commit 5b70c1c

File tree

4 files changed

+16
-89
lines changed

4 files changed

+16
-89
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frax-standard-solidity",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "A standard library for frax solidity",
55
"main": "src",
66
"directories": {
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@openzeppelin/contracts": "^5.4.0",
1919
"@types/fs-extra": "^11.0.4",
20-
"@types/node": "^18.19.120",
20+
"@types/node": "^24.2.1",
2121
"change-case": "^4.1.2",
2222
"commander": "^10.0.1",
2323
"date-fns": "^2.30.0",

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/FraxTest.sol

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,10 @@ import { VmHelper } from "./VmHelper.sol";
66
import { Strings } from "./StringsHelper.sol";
77

88
abstract contract FraxTest is VmHelper, Test {
9-
/// @notice Differential State Storage
10-
uint256[] internal snapShotIds;
11-
uint256 currentSnapShotId;
12-
function()[] internal setupFunctions;
13-
149
/// @notice EIP-1967 Slots
1510
bytes32 internal IMPLEMENTATION_SLOT = bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1);
1611
bytes32 internal ADMIN_SLOT = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1);
1712

18-
// ========================================================================
19-
// ~~~~~~~~~~~~~~~~~~ Different State Testing Helpers ~~~~~~~~~~~~~~~~~~~~~
20-
// ========================================================================
21-
22-
modifier useMultipleSetupFunctions() {
23-
if (snapShotIds.length == 0) _;
24-
for (uint256 i = 0; i < snapShotIds.length; i++) {
25-
uint256 _originalSnapshotId = vm.snapshotState();
26-
// currentSnapShotId = snapShotIds[i];
27-
if (!vm.revertToState(snapShotIds[i])) {
28-
revert VmDidNotRevert(snapShotIds[i]);
29-
}
30-
_;
31-
vm.clearMockedCalls();
32-
vm.revertToState(_originalSnapshotId);
33-
}
34-
}
35-
36-
function addSetupFunctions(function()[] memory _setupFunctions) internal {
37-
for (uint256 i = 0; i < _setupFunctions.length; i++) {
38-
_setupFunctions[i]();
39-
snapShotIds.push(vm.snapshotState());
40-
vm.clearMockedCalls();
41-
}
42-
}
43-
4413
// ========================================================================
4514
// ~~~~~~~~~~~~~~~~~~~~~~~ EIP-1967 Proxy Helpers ~~~~~~~~~~~~~~~~~~~~~~~~~
4615
// ========================================================================

test/TestMultipleSetup.t.sol

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)