Skip to content

feat(fee-engine): add integration tests and complete fee estimator JSDoc - #30

Open
RiH-137 wants to merge 1 commit into
Swapso-App:dev-branchfrom
RiH-137:feat/fee-engine-integration-tests-jsdoc
Open

feat(fee-engine): add integration tests and complete fee estimator JSDoc#30
RiH-137 wants to merge 1 commit into
Swapso-App:dev-branchfrom
RiH-137:feat/fee-engine-integration-tests-jsdoc

Conversation

@RiH-137

@RiH-137 RiH-137 commented Mar 16, 2026

Copy link
Copy Markdown

Adds a full integration test suite for the fee engine (rate fetch, tier comparison, cache behavior, retry fallback, and USD conversion), completes JSDoc across fee estimation functions, and updates the planning tracker to mark these tasks as done. Also stabilizes wallet signing tests by mocking fresh UTXO fetches so CI runs reliably offline.

Copilot AI review requested due to automatic review settings March 16, 2026 19:24

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.

Pull request overview

Adds a new FeeEstimator class for Bitcoin fee rate estimation with caching, retry logic, USD conversion, and tier comparison. Includes integration tests and stabilizes existing wallet signing tests by mocking UTXO fetches.

Changes:

  • New FeeEstimator class (.ts, .js, .d.ts) with mempool.space integration, caching, retry/fallback, and USD conversion
  • Integration test suite covering rate fetch, cache behavior, retry fallback, and USD conversion
  • Mock fetchFreshUtxos in existing wallet tests for offline CI reliability

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
btc-controller/src/helper/feeEstimator.ts New FeeEstimator class with fee rates, caching, retry, and USD helpers
btc-controller/src/helper/feeEstimator.js Compiled JS output of the TypeScript source
btc-controller/src/helper/feeEstimator.d.ts Type declarations for the FeeEstimator
btc-controller/test/feeEstimator.integration.js Integration tests for the fee engine
btc-controller/test/index.js Mock UTXO fetches for offline test stability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* - Each successful fetch is recorded in the rate history (max 10 entries).
*
* @param network 'MAINNET' (default) or 'TESTNET'
* @returns Recommended sat/vByte fee rates for all tiers.
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.

3 participants