feat(fee-engine): add integration tests and complete fee estimator JSDoc - #30
Open
RiH-137 wants to merge 1 commit into
Open
feat(fee-engine): add integration tests and complete fee estimator JSDoc#30RiH-137 wants to merge 1 commit into
RiH-137 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
FeeEstimatorclass (.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
fetchFreshUtxosin 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. |
revmarcuspeter-cyber
approved these changes
Apr 6, 2026
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.
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.