Skip to content

test: cover queryXlmBalance, estimateRequiredFee, resolvePassphrase + docs for StreamBuilder.ratePerSecond/submit - #467

Closed
pyper01 wants to merge 1 commit into
conduit-protocol:mainfrom
pyper01:fix/wave-test-coverage-and-docs
Closed

test: cover queryXlmBalance, estimateRequiredFee, resolvePassphrase + docs for StreamBuilder.ratePerSecond/submit#467
pyper01 wants to merge 1 commit into
conduit-protocol:mainfrom
pyper01:fix/wave-test-coverage-and-docs

Conversation

@pyper01

@pyper01 pyper01 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #460, Closes #461,Closes #462,Closes #463

Adds direct unit tests for three previously uncovered functions and fills the docs/api.md gap in the Fluent Builder reference:

  • Test gap: no coverage for queryXlmBalance() (src/soroban.ts) #460queryXlmBalance() (src/soroban.ts): new src/tests/soroban-query-xlm-balance.test.ts mocks SorobanRpc.Server's simulateTransaction()/getAccount() (via the same vi.hoisted + vi.mock('@stellar/stellar-sdk') pattern used by the existing RPC tests) and asserts the exact stroop value returned for small/zero/64-bit-spanning balances, the simulation-error rejection path, and that the correct account/tx are used for the balance() call against the native asset contract.

  • Test gap: no coverage for estimateRequiredFee() (src/soroban.ts) #461estimateRequiredFee() (src/soroban.ts): new src/tests/soroban-estimate-required-fee.test.ts locks in the 5_000_000_000n (~500 XLM) fallback for WasmVm/InvalidAction-shaped error results (the root cause of the overstatement bug called out in the issue), plus the minResourceFee/fee extraction for string/number/bigint shapes, precedence of minResourceFee over fee, skipping of zero/negative values, non-object inputs, and custom fallbacks.

  • Test gap: no coverage for resolvePassphrase() (src/batch-tx.ts) #462resolvePassphrase() (src/batch-tx.ts): new src/tests/batch-tx-resolve-passphrase.test.ts covers every branch: explicit passphrase present, explicit-over-network precedence, blank/whitespace-only passphrase falling through, each known named network, BatchBuildError for unknown networks, and BatchBuildError when neither is provided.

  • Docs: docs/api.md's StreamBuilder reference omits ratePerSecond() and submit() #463docs/api.md StreamBuilder reference: documents the previously omitted .ratePerSecond(val: number | bigint) and .submit(submitFn, options) methods (including the full SubmitOptions: retries, backoff, concurrency, queue backpressure, AbortSignal), with usage examples for both.

Verification

  • npm test746 passed, 2 skipped (60 files, incl. the 3 new test files: 24 new tests)
  • npm run typecheck — clean

Changelog

CHANGELOG.md updated under [Unreleased]Added (test coverage) and Documentation (StreamBuilder methods).

…document StreamBuilder ratePerSecond/submit

Add direct unit tests for three previously uncovered functions (mocked
RPC simulation for the balance query, fallback/extraction shapes for the
fee estimate, and every branch of the batch passphrase resolver), and
document StreamBuilder.ratePerSecond() and submit() in docs/api.md.

Closes conduit-protocol#460, conduit-protocol#461, conduit-protocol#462, conduit-protocol#463

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

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

@Jaydbrown

Copy link
Copy Markdown
Contributor

Thanks for the contribution here — squash-merging this now. Any follow-ups we'll track in a fresh issue. 🚀

Jaydbrown added a commit that referenced this pull request Aug 26, 2026
… StreamBuilder docs (#467)

Co-authored-by: pyper01 <pyper01@users.noreply.github.com>
@Jaydbrown

Copy link
Copy Markdown
Contributor

Merged into main as b43ac60 (hand-rebased — fork edits weren't enabled). The 3 test files and the StreamBuilder.ratePerSecond/submit() doc additions all landed; I refreshed one estimateRequiredFee fallback assertion (5_000_000_000n → 1_000_000n) since #477 replaced the ~500 XLM fallback with the realistic 0.1 XLM one. Attributed via Co-authored-by. Closing — thanks, @pyper01! 🙏

@Jaydbrown Jaydbrown closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants