Skip to content

feat(batch): add dryRun simulation option to submitBatch (closes #608) - #687

Open
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-608-submit-batch-dry-run
Open

feat(batch): add dryRun simulation option to submitBatch (closes #608)#687
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-608-submit-batch-dry-run

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary

Adds a { dryRun: true } option to submitBatch that simulates every transaction against the Soroban RPC instead of broadcasting on-chain, returning would-be outcomes for pre-flight validation UIs without consuming sequence numbers or funds (closes #608).

Key Changes

  • src/batch-tx.ts:
    • Added dryRun?: boolean to BatchSubmitOptions.
    • In submitBatch, when options.dryRun is enabled, simulates each transaction using server.simulateTransaction(tx).
    • Records SUCCESS for valid simulations and FAILED for simulation errors without calling server.sendTransaction or polling.
    • Enforces fail-fast behavior: marks subsequent transactions as SKIPPED upon the first simulation error.
  • src/tests/batch-submit.test.ts:
    • Added unit test suite covering successful dry-run batches, simulation error handling with subsequent skips, and network/RPC simulation failures.

Verification

  • vitest run src/tests/batch-submit.test.ts: 22/22 tests passing.
  • Clean production build with npm run build.

Copilot AI lite review requested due to automatic review settings September 6, 2026 00:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

submitBatch dryRun option

2 participants