Skip to content

Commit

Permalink
fix: more precisely mine blocks and advance time
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed Nov 16, 2024
1 parent 82966c0 commit 9278514
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/execute/plan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,8 @@ describe('plan', () => {
await testClient.getBalance({ address: receiver.address })
).toEqual(0n)

await testClient.request({
method: 'anvil_mine' as any,
params: [cooldown],
await testClient.increaseTime({
seconds: cooldown * 2,
})

await execute(plan, state, testClient as Eip1193Provider, {
Expand Down Expand Up @@ -861,9 +860,8 @@ describe('plan', () => {
...execute1.transaction,
})

await testClient.request({
method: 'anvil_mine' as any,
params: [cooldown],
await testClient.increaseTime({
seconds: cooldown * 2,
})

expect(await testClient.getBalance({ address: safe })).toEqual(
Expand Down Expand Up @@ -1236,9 +1234,8 @@ describe('plan', () => {
} catch (e) {}
expect(state).toHaveLength(1)

await testClient.request({
method: 'anvil_mine' as any,
params: [cooldown],
await testClient.increaseTime({
seconds: cooldown * 2,
})

expect(await testClient.getBalance({ address: safe })).toEqual(
Expand Down Expand Up @@ -1342,9 +1339,8 @@ describe('plan', () => {
...execute1.transaction,
})

await testClient.request({
method: 'anvil_mine' as any,
params: [cooldown],
await testClient.increaseTime({
seconds: cooldown * 2,
})

expect(await testClient.getBalance({ address: safe })).toEqual(
Expand Down

0 comments on commit 9278514

Please sign in to comment.