test(cli): E2E testnet deployment flow — sign, assemble fees, await confirmation (#708) - #848
Open
aakolawole2-byte wants to merge 1 commit into
Conversation
…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.
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-testandupgrade's on-chain submission path never signed their transactions and submitted them with a hardcodedfee: "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
cli/src/utils/soroban-tx.ts: a sharedprepareSignAndSubmit/pollForConfirmationhelper that simulates + assembles the fee/footprint (server.prepareTransaction), signs the assembled transaction, submits it, and pollsgetTransactionuntil a terminal status or a caller-supplied deadline — real Testnet confirmation takes several ledgers (~5–15s), unlike a mock's instant response.smoke-test.ts(mint/transfer) andupgrade.ts(on-chain submit path) through this helper.upgradegained a--timeoutflag mirroringsmoke-test's.--estimate/--dry-runpaths are untouched (still simulate-only, no submission).NOT_FOUND), and timeout handling — insoroban-tx.test.ts,smoke.test.ts, andupgrade.test.ts.e2e-testnet.test.ts) that runs the full smoke-test flow against real Testnet whenRUN_E2E_TESTNET=trueplus a fundedE2E_TESTNET_SECRETandE2E_TOKEN_CONTRACT_IDare supplied; skipped by default so normal CI never depends on live network availability or funded credentials.Testing
npm run build(tsc -b) — passesnpm run lint(tsc --noEmit) — passesnpm test(vitest) — 117 passed, 2 skipped (the opt-in live E2E tests)