-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e557297
commit 460e800
Showing
15 changed files
with
106 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,4 +127,4 @@ test('useSimulateDepositERC20', async () => { | |
"status": "success", | ||
} | ||
`) | ||
}) | ||
}, { retry: 3 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/hooks/L1/useSimulateProveWithdrawalTransaction.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { expect, test } from 'vitest' | ||
import { renderHook, waitFor } from '../../_test/react.js' | ||
import { useSimulateProveWithdrawalTransaction } from './useSimulateProveWithdrawalTransaction.js' | ||
|
||
test('useSimulateProveWithdrawalTransaction', async () => { | ||
const { result } = renderHook(() => | ||
useSimulateProveWithdrawalTransaction({ | ||
args: { | ||
withdrawalTxHash: '0xf735fdde9e33a002dcfe8d3fb2ca059c585d538a0e3ddc561d6fdcc303cff408', | ||
}, | ||
l2ChainId: 8453, | ||
query: { retry: false }, | ||
}) | ||
) | ||
|
||
// We're only checking that we're able to successfully call the contract. The snapshot | ||
// will continue to change as blocks get procuded, and this check is sufficient. | ||
await waitFor(() => expect(result.current.isSuccess).toBeTruthy()) | ||
}, { retry: 3 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect, test } from 'vitest' | ||
import { renderHook, waitFor } from '../../_test/react.js' | ||
import { useWriteProveWithdrawalTransaction } from './useWriteProveWithdrawalTransaction.js' | ||
|
||
test('useWriteProveWithdrawalTransaction', async () => { | ||
const { result } = renderHook(() => useWriteProveWithdrawalTransaction()) | ||
|
||
expect(result.current.writeProveWithdrawalTransaction).toBeDefined() | ||
expect(result.current.writeProveWithdrawalTransaction).toBeDefined() | ||
expect(result.current.data).toBeUndefined() | ||
expect(result.current.isIdle).toBe(true) | ||
|
||
result.current.writeProveWithdrawalTransaction({ | ||
args: { | ||
withdrawalTxHash: '0xf735fdde9e33a002dcfe8d3fb2ca059c585d538a0e3ddc561d6fdcc303cff408', | ||
}, | ||
l2ChainId: 8453, | ||
}) | ||
|
||
await waitFor(() => { | ||
expect(result.current.error).toBeNull() | ||
// We're only checking that we're able to successfully call the contract. The snapshot | ||
// will continue to change as blocks get procuded, and this check is sufficient. | ||
expect(result.current.isSuccess).toBeTruthy() | ||
}) | ||
}, { retry: 3 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters