Skip to content

Commit 37d9ca9

Browse files
authored
test: fix deployer create prediction, always run in isolate mode (#94)
* fix: fix deployer create prediction, always run in isolate mode * feat: upd ci
1 parent 3ec3b1f commit 37d9ca9

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

.github/workflows/certora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121
with:
2222
submodules: recursive
2323

.github/workflows/foundry-gas-diff.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
compare_gas_reports:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
with:
2222
submodules: recursive
2323

2424
- name: Install Foundry
2525
uses: onbjerg/foundry-toolchain@v1
2626
with:
27-
version: nightly
27+
version: stable
2828

2929
# Add any step generating a gas report to a temporary file named gasreport.ansi
3030
# For example:
@@ -38,7 +38,7 @@ jobs:
3838
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
3939

4040
- name: Compare gas reports
41-
uses: Rubilmax/foundry-gas-diff@v3.11
41+
uses: Rubilmax/foundry-gas-diff@v3.21
4242
with:
4343
sortCriteria: avg,max # optionnally sort diff rows by criteria
4444
sortOrders: desc,asc # and directions
@@ -51,4 +51,4 @@ jobs:
5151
with:
5252
# delete the comment in case changes no longer impact gas costs
5353
delete: ${{ !steps.gas_diff.outputs.markdown }}
54-
message: ${{ steps.gas_diff.outputs.markdown }}
54+
message: ${{ steps.gas_diff.outputs.markdown }}

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ jobs:
66
tests:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010

1111
- name: Install Foundry
1212
uses: onbjerg/foundry-toolchain@v1
1313
with:
14-
version: nightly
14+
version: stable
1515

1616
- name: Install dependencies
1717
run: forge install
@@ -23,4 +23,4 @@ jobs:
2323
env:
2424
POLYGON_RPC_URL: ${{ secrets.POLYGON_RPC_URL }}
2525
AVALANCHE_RPC_URL: ${{ secrets.AVALANCHE_RPC_URL }}
26-
run: forge test -vv
26+
run: forge test -vvv

foundry.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ optimizer-runs = 10_000_000
66
via_ir = false
77
runs = 256
88
gas_reports = ["ATokenVault"]
9+
isolate = true
910

1011
[fuzz]
1112
max_test_rejects = 65536
@@ -20,4 +21,4 @@ polygon = "${POLYGON_RPC_URL}"
2021

2122
[etherscan]
2223
mumbai = { key = "${ETHERSCAN_API_KEY}" }
23-
polygon = { key = "${ETHERSCAN_API_KEY}" }
24+
polygon = { key = "${ETHERSCAN_API_KEY}" }

test/ATokenVaultBaseTest.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ contract ATokenVaultBaseTest is Test {
133133
SHARE_SYMBOL,
134134
_initialLockDeposit
135135
);
136-
address proxyAddr = computeCreateAddress(address(this), vm.getNonce(address(this)));
137136

138137
deal(underlying, address(this), _initialLockDeposit);
138+
address proxyAddr = computeCreateAddress(address(this), vm.getNonce(address(this)) + 1);
139+
139140
IERC20Upgradeable(underlying).safeApprove(address(proxyAddr), _initialLockDeposit);
140141

141142
TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(vault), PROXY_ADMIN, data);

test/ATokenVaultFork.t.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ contract ATokenVaultForkTest is ATokenVaultForkBaseTest {
186186
SHARE_SYMBOL,
187187
amount
188188
);
189-
address proxyAddr = computeCreateAddress(address(this), vm.getNonce(address(this)));
190189

191190
deal(address(dai), address(this), amount);
191+
address proxyAddr = computeCreateAddress(address(this), vm.getNonce(address(this)) + 1);
192+
192193
dai.approve(address(proxyAddr), amount);
193194

194195
TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(vault), PROXY_ADMIN, data);
@@ -217,9 +218,10 @@ contract ATokenVaultForkTest is ATokenVaultForkBaseTest {
217218
SHARE_SYMBOL,
218219
initialLockDeposit
219220
);
220-
address proxyAddr = computeCreateAddress(address(this), vm.getNonce(address(this)));
221-
221+
222222
deal(address(dai), address(this), initialLockDeposit);
223+
address proxyAddr = computeCreateAddress(address(this), vm.getNonce(address(this)) + 1);
224+
223225
dai.approve(address(proxyAddr), initialLockDeposit);
224226

225227
// no indexed fields, just data check (4th param)

0 commit comments

Comments
 (0)