Skip to content

test(backend): add Soroban E2E contract flow tests (#533)#538

Merged
Cedarich merged 10 commits into
Pulsefy:mainfrom
shadrach68:contractFlow
Jun 2, 2026
Merged

test(backend): add Soroban E2E contract flow tests (#533)#538
Cedarich merged 10 commits into
Pulsefy:mainfrom
shadrach68:contractFlow

Conversation

@shadrach68
Copy link
Copy Markdown
Contributor

closes #533

Summary

Resolves #533 (BE-56).

This PR introduces a gated end-to-end test suite that executes real Soroban contract flows against the Stellar Testnet. It validates the full lifecycle (deposit → backend indexer polling → refund) to ensure contract deployments and backend indexers function properly together and to prevent future regressions.

Changes Made

  • Gated CI Pipeline: Added .github/workflows/soroban-e2e.yml configured to run only on workflow_dispatch (on-demand) or pushes to the protected main branch. This secures the E2E_WALLET_SECRET.
  • E2E Test Runner: Implemented app/backend/test/soroban-flow.e2e-spec.ts which uses @stellar/stellar-sdk and NestJS utilities to directly invoke the Soroban RPC.
  • Network Validation: Added strict checks to ensure the network passphrase strictly matches Networks.TESTNET before simulating or signing transactions.
  • Backend Indexer Validation: The suite actively polls the backend (/api/transactions/:hash) to confirm the emitted events/transactions are successfully indexed.
  • Idempotency & Cleanup: Implemented a randomized 32-byte salt (runSalt) to generate unique, idempotent commitments per run. The test strictly concludes with a refund call to recover testnet XLM and clean up the contract state.
  • Rate Limiting: Added synthetic delays between transactions to prevent spamming the Soroban RPC.

Acceptance Criteria

  • CI can run E2E safely without leaking secrets or requiring private key custody in the app.
  • Tests fail with actionable output (which step, which tx hash, which event missing).
  • Running the suite multiple times produces deterministic results (handled via idempotent salts and proper cleanup).

How to Test

  1. Ensure E2E_WALLET_SECRET and QUICKEX_CONTRACT_ID are configured in GitHub Actions Secrets.
  2. Navigate to the Actions tab in GitHub.
  3. Select Backend Soroban E2E (Testnet) and click Run workflow.
  4. Verify the logs successfully deposit, validate the indexer, and process the refund cleanup without leaking any secret keys.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@shadrach68 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

@Cedarich
Copy link
Copy Markdown
Contributor

Cedarich commented Jun 1, 2026

@shadrach68 fix workflow

@Cedarich
Copy link
Copy Markdown
Contributor

Cedarich commented Jun 2, 2026

@shadrach68

@shadrach68
Copy link
Copy Markdown
Contributor Author

Please, I am currently working on it, sir @Cedarich

@shadrach68 shadrach68 closed this Jun 2, 2026
@shadrach68 shadrach68 reopened this Jun 2, 2026
@shadrach68
Copy link
Copy Markdown
Contributor Author

I have resolved the issue sir @Cedarich

@Cedarich Cedarich merged commit 282511c into Pulsefy:main Jun 2, 2026
2 checks passed
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.

BE-56: Soroban E2E Contract Flow Tests (Testnet, Gated CI)

2 participants