Skip to content

Wire-Network/wire-tools-ts

Repository files navigation

wire-tools-ts

End-to-end integration tests for the WIRE OPP (Outpost Protocol) cross-chain messaging system.

Overview

Exercises the full OPP message flow across three blockchains:

  • WIRE (nodeop + kiod) — Depot contracts (sysio.epoch, sysio.msgch, sysio.uwrit, sysio.chalg)
  • Ethereum (anvil) — Outpost contracts (OPP, OPPInbound, OperatorRegistry, OutpostReserve)
  • Solana (solana-test-validator) — Outpost program (opp-solana-outpost)

Packages

Package Description
@wireio/test-cluster-tool Process management (nodeop, anvil, solana-test-validator) + chain clients
@wireio/test-flow-operator-collateral-deposit Flow: Node Operator Collateral Deposit
@wireio/test-flow-swap-with-underwriting Flow: Bidirectional SWAP (Ethereum ↔ Solana) with Underwriting
@wireio/test-flow-batch-operator-termination Flow: Batch Operator Termination via Delivery Underperformance
@wireio/test-flow-swap-variance-revert Flow: Swap Variance-Tolerance Revert

Prerequisites

  • nodeop + kiod built in wire-sysio
  • anvil (Foundry) installed
  • solana-test-validator (Agave) installed
  • Node.js >= 22, pnpm

Installing Anvil, Foundry, and Solana CLI

# -- Rust --
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
PATH="${CARGO_HOME}/bin:${PATH}"

# -- Foundry (Anvil) --
curl -L https://foundry.paradigm.xyz | bash \
    && ${HOME}/.foundry/bin/foundryup
PATH="${HOME}/.foundry/bin:${PATH}"

# -- Solana CLI (solana-test-validator) --
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" 
PATH="${HOME}/.local/share/solana/install/active_release/bin:${PATH}"

Setup

pnpm install

Running Tests

# All flows
pnpm test

# Individual flows
pnpm --filter @wireio/test-flow-operator-collateral-deposit test
pnpm --filter @wireio/test-flow-swap-with-underwriting test
pnpm --filter @wireio/test-flow-batch-operator-termination test
pnpm --filter @wireio/test-flow-swap-variance-revert test

# With custom build dir
WIRE_BUILD_DIR=/path/to/build pnpm --filter @wireio/test-flow-operator-collateral-deposit test

Environment Variables

Variable Default Description
WIRE_BUILD_DIR wire-sysio/build/claude Path to wire-sysio build directory
WIRE_CHAIN_DIR /tmp/wire-e2e-flow-* Chain data directory
LOG_LEVEL info Harness log level (debug, info, warn, error)

Architecture

The harness manages child processes with PID tracking, signal handling, and tree-kill cleanup (inspired by wire-sysio/tools/cluster_manager.py). Each flow test:

  1. Starts required chain processes
  2. Deploys contracts
  3. Executes the OPP epoch cycle
  4. Verifies attestation propagation and state consistency
  5. Tears down all processes

Code Style

  • Prettier: no semicolons, no trailing commas, double quotes, 2-space indent, arrow parens avoid

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors