SDK Integration Smoke Test Harness - #594
Merged
Merged
Conversation
- Add FinalityChecker class for tx finality polling and finalized PaymentReceipts with Horizon-derived effectSummary - Extend PaymentReceipt with optional status and effectSummary fields - Add preflightCheck and getReceipt methods to StellarSplitClient - Export FinalityChecker from public API - Add end-to-end smoke test gated by STELLAR_TESTNET_SMOKE=1 exercising full invoice flow against Stellar testnet
|
@attyolu 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! 🚀 |
6 tasks
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 #551
Summary
Adds an end-to-end smoke test suite that exercises the full happy-path flow — create invoice → preflight check → submit payment → verify receipt → check finality — against Stellar testnet using real Horizon calls and funded test accounts. Also adds the supporting SDK infrastructure (
FinalityChecker,preflightCheck(),getReceipt()) required to support this flow.Motivation
Without this harness, regressions in Horizon API compatibility,
@stellar/stellar-sdkupgrades, or cross-module integration are only caught in production. This CI-gated integration test catches them before merge.Changes
New Files
src/finalityChecker.tsFinalityCheckerclass that polls Soroban RPC for tx success, waits forminConfirmationsledger depth, then builds a finalizedPaymentReceiptwith Horizon-derivedeffectSummarytests/integration/smokeTest.tsModified Files
src/receipt.tsPaymentReceipt/PaymentReceiptJSONwith optionalstatusandeffectSummaryfields; updated serialization and deserializationsrc/client.tspreflightCheck()(invoice status + expiry + payer readiness) andgetReceipt()methods toStellarSplitClientsrc/index.tsFinalityCheckerfrom public APISmoke Test Flow
Keypair.random()accounts (creator, payer, recipient1, recipient2) and funds them via Friendbot (https://friendbot.stellar.org)client.createInvoice()client.preflightCheck()and asserts invoice is pending, not expired, and payer has sufficient balanceclient.submitPayment()for the full invoice amountclient.getReceipt()and assertsinvoiceId,payer,totalPaid, andproofHashFinalityChecker.check()withminConfirmations: 2and assertsstatus === "finalized"with correcteffectSummarybalance deltasGating
STELLAR_TESTNET_SMOKEis not set to"1"@integrationto exclude from the defaultnpm testrunvi.mock()to use rawKeypairsigning (no Freighter dependency)How to Run
Checklist
Smoke test funds two Keypair accounts and creates a 2-recipient invoice with 60/40 split
Calls
preflightCheck()and asserts all preflight checks pass before submissionSubmits payment and waits for finality via
FinalityChecker.check()withminConfirmations: 2Asserts
PaymentReceipt.status === 'finalized'andeffectSummaryreflects correct balance deltasTest is skipped when
STELLAR_TESTNET_SMOKEis not set; tagged as@integrationTypeScript compilation passes for all new/modified files
No merge conflicts with
Test-HarnessbranchAdd FinalityChecker class for tx finality polling and finalized PaymentReceipts with Horizon-derived effectSummary
Extend PaymentReceipt with optional status and effectSummary fields
Add preflightCheck and getReceipt methods to StellarSplitClient
Export FinalityChecker from public API
Add end-to-end smoke test gated by STELLAR_TESTNET_SMOKE=1 exercising full invoice flow against Stellar testnet