#!/usr/bin/env bash
# Test cross-chain WETH transfers

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"


log_info "=== Cross-Chain Transfer Test ==="

# Load environment
if [ -f "$PROJECT_ROOT/.env" ]; then
    source "$PROJECT_ROOT/.env"
fi

log_info "Test Checklist:"
echo "1. ✅ Verify bridges are deployed on both chains"
echo "2. ⏳ Configure bridge destinations (addDestination)"
echo "3. ⏳ Fund bridges with LINK for CCIP fees"
echo "4. ⏳ Test WETH9 transfer: Mainnet → Chain-138"
echo "5. ⏳ Test WETH9 transfer: Chain-138 → Mainnet"
echo "6. ⏳ Test WETH10 transfer: Mainnet → Chain-138"
echo "7. ⏳ Test WETH10 transfer: Chain-138 → Mainnet"
log_warn "⚠️  Manual testing required"
echo "Test commands:"
echo "  # On Mainnet:"
echo "  cast send <BRIDGE_ADDRESS> \"sendCrossChain(uint64,address,uint256)\" <CHAIN138_SELECTOR> <RECIPIENT> <AMOUNT> --rpc-url <MAINNET_RPC> --private-key <KEY>"
echo "  # On Chain-138:"
echo "  cast send <BRIDGE_ADDRESS> \"sendCrossChain(uint64,address,uint256)\" <ETH_SELECTOR> <RECIPIENT> <AMOUNT> --rpc-url <CHAIN138_RPC> --private-key <KEY>"
