Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deposit/withdrawal wstETH test variants for different state of L1/L2 #38

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Tests

## Unit
Unit tests for smart contracts. Due to their close relation, some tests create multiple real contract instances instead of using mocks.

## Integration
Run on forks only
### Non-rebasable token (wstETH) bridging tests
Testing the positive scenario of bridging the wstETH token. For `stETH on OP`, a series of tests were created to verify the state during the upgrade process.
#### L1 and L2 has only wstETH bridging. Pre-stETH upgrade state.
```bash
npx hardhat test ./test/integration/bridging-non-rebasable-old_L1-old_L2.integration.test.ts
```
#### State when L1 already upgraded and L2 isn't. Half-baked stETH on Op upgrade state.
```bash
npx hardhat test ./test/integration/bridging-non-rebasable-new_L1-old_L2.integration.test.ts
```
#### State when both L1 and L2 are upgraded.
```bash
npx hardhat test ./test/integration/bridging-non-rebasable.integration.test.ts
```
## managing-e2e
These tests are designed to run on a real blockchain and modify some important state. Therefore, they should only be used on a testnet.

## e2e
These tests are designed to run on a real blockchain. However, due to the lengthy withdrawal process on Optimism, it is necessary to manually complete the withdrawals by first running the prove step
```bash
export TX_HASH=<take_it_from_bridging...e2e.test.ts>
npx ts-node --files ./scripts/optimism/prove-message.ts
```
and then finalizing it after 7 days.
```bash
export TX_HASH=<take_it_from_previouse_step>
npx ts-node --files ./scripts/optimism/finalize-message.ts
```



Loading
Loading