Skip to content

test(cli): E2E testnet deployment flow — sign, assemble fees, await confirmation (#708) - #848

Open
aakolawole2-byte wants to merge 1 commit into
BCPathway:mainfrom
aakolawole2-byte:feature/issue-708-e2e-testnet-deployment
Open

test(cli): E2E testnet deployment flow — sign, assemble fees, await confirmation (#708)#848
aakolawole2-byte wants to merge 1 commit into
BCPathway:mainfrom
aakolawole2-byte:feature/issue-708-e2e-testnet-deployment

Conversation

@aakolawole2-byte

Copy link
Copy Markdown

Closes #708.

What this covers

Issue #708 asks to run the CLI's deployment flow against Testnet/Futurenet, use testnet credentials, and verify the CLI handles real network latency and fees.

Writing that test surfaced a real bug: smoke-test and upgrade's on-chain submission path never signed their transactions and submitted them with a hardcoded fee: "100", never applying the resource fee/footprint Soroban assigns during simulation. The existing mocked unit tests passed regardless (mocks don't validate signatures or fees), but every real Testnet invocation of these commands would be rejected outright — unsigned transactions and underpriced Soroban invocations are both hard failures on a real RPC node.

Changes

  • Added cli/src/utils/soroban-tx.ts: a shared prepareSignAndSubmit/pollForConfirmation helper that simulates + assembles the fee/footprint (server.prepareTransaction), signs the assembled transaction, submits it, and polls getTransaction until a terminal status or a caller-supplied deadline — real Testnet confirmation takes several ledgers (~5–15s), unlike a mock's instant response.
  • Wired smoke-test.ts (mint/transfer) and upgrade.ts (on-chain submit path) through this helper. upgrade gained a --timeout flag mirroring smoke-test's.
  • --estimate/--dry-run paths are untouched (still simulate-only, no submission).
  • Unit tests (mocked, run in normal CI): happy path (sign + fee assembly + confirm), simulation failure, submission failure, confirmation-latency tolerance (polls past transient NOT_FOUND), and timeout handling — in soroban-tx.test.ts, smoke.test.ts, and upgrade.test.ts.
  • Opt-in live E2E suite (e2e-testnet.test.ts) that runs the full smoke-test flow against real Testnet when RUN_E2E_TESTNET=true plus a funded E2E_TESTNET_SECRET and E2E_TOKEN_CONTRACT_ID are supplied; skipped by default so normal CI never depends on live network availability or funded credentials.

Testing

  • npm run build (tsc -b) — passes
  • npm run lint (tsc --noEmit) — passes
  • npm test (vitest) — 117 passed, 2 skipped (the opt-in live E2E tests)

…onfirmation (BCPathway#708)

smoke-test and upgrade never signed their transactions and submitted them
with a hardcoded fee, ignoring the resource fee/footprint Soroban assigns
during simulation. Mocked unit tests passed regardless, but every real
Testnet invocation of these commands would be rejected as unsigned and
underpriced.

Adds a shared prepareSignAndSubmit/pollForConfirmation helper that
simulates, assembles the fee/footprint, signs, submits, and polls for
on-ledger confirmation (real Testnet transactions typically take several
ledgers to finalize, unlike a mock's instant response), and wires both
commands through it. Covers the fix with mocked unit tests for the happy
path, simulation failures, submission failures, confirmation latency, and
timeout handling, plus an opt-in live-Testnet E2E suite (RUN_E2E_TESTNET=true
+ funded credentials) that stays skipped in normal CI so this doesn't
introduce flaky, network-dependent CI failures.
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@aakolawole2-byte Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] E2E: Testnet deployment flow

1 participant