Skip to content
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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VITE_FEATURE_GNOSIS=true
VITE_FEATURE_ARBITRUM=true
VITE_FEATURE_ARBITRUM_NOVA=false
VITE_FEATURE_SOLANA=true
VITE_FEATURE_SUI=false
VITE_FEATURE_SUI=true
VITE_FEATURE_MAYACHAIN=true
VITE_FEATURE_BASE=true
VITE_FEATURE_OPTIMISM=true
Expand Down
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ VITE_FEATURE_MIXPANEL=true

VITE_FEATURE_TX_HISTORY_BYE_BYE=true
VITE_FEATURE_SWAPPER_FIAT_RAMPS=true
VITE_FEATURE_SUI=true

VITE_FEATURE_NOTIFICATIONS_WEBSERVICES=true
# Turn those on if you use local development instead of our railway instance
Expand Down
137 changes: 136 additions & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,139 @@ act -s GITHUB_TOKEN=$GITHUB_TOKEN -j <job-name> --reuse

Two important flags that can be passed to the `act` command:
- `--reuse` - persist state across runs
- `--rm` - remove container on failure
- `--rm` - remove container on failure

## Swapper Integration Testing

For PRs related to swapper integrations, swapper behavior changes, or quote aggregation, **actual swap execution testing is required** to ensure production readiness.

### When Swap Execution Testing is Required

Execute actual swaps when the PR involves:

1. **New Swapper Integration**: Adding support for a new DEX aggregator, bridge, or swapper
- Examples: Integrating Bebop, Portals, Jupiter, 0x, 1inch, Relay, Cetus, etc.

2. **Swapper Behavior Changes**: Modifying existing swapper logic
- Fee calculation changes
- Quote fetching modifications
- Route optimization updates
- Slippage tolerance adjustments

3. **Chain Adapter Modifications**: Changes to chain adapters affecting swap flows
- New chain support for swaps
- Gas estimation changes
- Transaction building modifications

4. **Quote Aggregation Changes**: Updates to how quotes are fetched, sorted, or presented
- Multi-swapper aggregation logic
- Quote filtering/sorting algorithms
- Rate calculation modifications

### Testing Requirements

#### Minimum Testing Scope

For each swapper-related PR, execute **at least 2 successful swaps**:

1. **Primary swap direction**: Test the main use case
- Example: ETH → USDC on the new swapper

2. **Secondary swap direction**: Test reverse or alternative route
- Example: USDC → ETH or ETH → BTC

3. **Cross-chain swap (if applicable)**: Test bridge/cross-chain functionality
- Example: USDC on Arbitrum → New Chain (Plasma, SUI, HyperEVM, Monad, etc.)
- Example: ETH on Ethereum → Asset on new chain
- Verify cross-chain route aggregation and bridge selection

#### Comprehensive Testing Checklist

- [ ] **Quote Accuracy**: Verify quoted rates match executed rates (within acceptable slippage)
- [ ] **Balance Updates**: Confirm source and destination balances update correctly post-swap
- [ ] **Fee Estimation**: Validate transaction fees match estimates
- [ ] **Transaction Completion**: Ensure swaps complete successfully with proper notifications
- [ ] **Error Handling**: Test edge cases (insufficient balance, no routes, etc.)
- [ ] **Multi-chain Support**: For cross-chain swappers, test bridge functionality
- [ ] **Price Impact**: Verify price impact calculations are accurate
- [ ] **Slippage Tolerance**: Test swaps near slippage limits
- [ ] **Transaction History Parsing**: Verify TX history displays correctly for new chains/swappers
- Navigate to asset page and verify TX appears in history
- Click on TX row to open details drawer
- Verify all TX details are correct (amount, fee, timestamp, addresses, status)
- Check that TX type is correctly identified (swap, send, receive, etc.)
- [ ] **Cross-chain TX Tracking**: For bridge swaps, verify both source and destination TX appear

### Testing Methodology

#### Local Development Testing

```bash
# 1. Start local development environment
yarn dev

# 2. Use browser automation (Playwright) or manual testing
# Connect wallet and execute test swaps

# 3. Document results in PR comment
```

#### Required Test Documentation

Include the following in your PR:

```markdown
## Swap Execution Test Results

### Test 1: [Asset A] → [Asset B]

**Setup**:
- Direction: [Asset A] → [Asset B]
- Amount: [amount]
- Protocol: [swapper name]

**Pre-Swap Balances**:
- [Asset A]: [balance]
- [Asset B]: [balance]

**Quote Details**:
- Expected output: [amount]
- Exchange rate: [rate]
- Fee: [fee]
- Price impact: [%]

**Execution**: ✅ Success / ❌ Failed
- Transaction hash: [hash]
- Block explorer: [link]

**Post-Swap Balances**:
- [Asset A]: [balance] (change: [delta])
- [Asset B]: [balance] (change: [delta])

**Verification**:
- ✅/❌ Quote accuracy
- ✅/❌ Balance updates
- ✅/❌ Fee estimation
- ✅/❌ Transaction notification

**Notes**: [any observations]
```

### Testing Best Practices

1. **Use Testnet When Possible**: Prefer testnets for initial validation, but include at least 1 mainnet swap for production verification
2. **Document Edge Cases**: Note any limitations, directional liquidity issues, or unsupported routes
3. **Test Multiple Amounts**: Small, medium, and large swaps may have different behaviors
4. **Monitor Console Errors**: Document any errors or warnings during swap execution
5. **Verify UI/UX**: Ensure loading states, notifications, and error messages display correctly

### Example Test Reports

See `.playwright-mcp/swap-execution-test-report.md` for comprehensive testing examples.

### Automated Testing (Future)

While manual swap execution is currently required, we aim to automate this with:
- Playwright end-to-end tests
- Mock swapper responses for unit tests
- Testnet automation for CI/CD pipelines
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,24 @@
"@shapeshiftoss/chain-adapters": "workspace:^",
"@shapeshiftoss/contracts": "workspace:^",
"@shapeshiftoss/errors": "workspace:^",
"@shapeshiftoss/hdwallet-coinbase": "1.62.31",
"@shapeshiftoss/hdwallet-core": "1.62.31",
"@shapeshiftoss/hdwallet-gridplus": "1.62.31",
"@shapeshiftoss/hdwallet-keepkey": "1.62.31",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.31",
"@shapeshiftoss/hdwallet-keplr": "1.62.31",
"@shapeshiftoss/hdwallet-ledger": "1.62.31",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.31",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.31",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.31",
"@shapeshiftoss/hdwallet-native": "1.62.31",
"@shapeshiftoss/hdwallet-native-vault": "1.62.31",
"@shapeshiftoss/hdwallet-phantom": "1.62.31",
"@shapeshiftoss/hdwallet-trezor": "1.62.31",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.31",
"@shapeshiftoss/hdwallet-vultisig": "1.62.31",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.31",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.31",
"@shapeshiftoss/hdwallet-coinbase": "1.62.32",
"@shapeshiftoss/hdwallet-core": "1.62.32",
"@shapeshiftoss/hdwallet-gridplus": "1.62.32",
"@shapeshiftoss/hdwallet-keepkey": "1.62.32",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.32",
"@shapeshiftoss/hdwallet-keplr": "1.62.32",
"@shapeshiftoss/hdwallet-ledger": "1.62.32",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.32",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.32",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.32",
"@shapeshiftoss/hdwallet-native": "1.62.32",
"@shapeshiftoss/hdwallet-native-vault": "1.62.32",
"@shapeshiftoss/hdwallet-phantom": "1.62.32",
"@shapeshiftoss/hdwallet-trezor": "1.62.32",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.32",
"@shapeshiftoss/hdwallet-vultisig": "1.62.32",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.32",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.32",
"@shapeshiftoss/swapper": "workspace:^",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/chain-adapters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"dependencies": {
"@mysten/sui": "1.45.0",
"@shapeshiftoss/caip": "workspace:^",
"@shapeshiftoss/hdwallet-core": "1.62.31",
"@shapeshiftoss/hdwallet-ledger": "1.62.31",
"@shapeshiftoss/hdwallet-core": "1.62.32",
"@shapeshiftoss/hdwallet-ledger": "1.62.32",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
Loading
Loading