fix: fetch aggregate mempool state endpoint - #3
Open
tolga-tom-nook wants to merge 1 commit into
Open
Conversation
This was referenced May 25, 2026
|
Review assist for maintainers: This looks like a focused SDK endpoint correction: Suggested merge checks:
Main acceptance criterion: aggregate mempool-state callers should hit |
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.
Summary
Fixes
getMempoolState()so it calls the aggregate mempool state endpoint instead of the paginated mempool transaction-list endpoint.Before this change,
getMempoolState()built this URL:That returns a transaction list shape (
count,page,pages,list) rather than the mempool state shape. This PR switches the method to:/mempool/stateand strengthens the regression test so it awaits the SDK call and asserts state fields (
inputs,outputs,transactions) instead of only checking that a Promise object exists.RED / GREEN validation
RED proof before the code fix, after strengthening the test:
npx jest src/__tests__/mempool.test.ts --runInBand --no-cache --coverage=false --testNamePattern 'should fetch mempool state'Failed because the method returned the transaction-list object and did not contain
inputs.GREEN after the fix:
npx jest src/__tests__/mempool.test.ts --runInBand --no-cache --coverage=false --testNamePattern 'should fetch mempool state'Result:
Broader validation:
Results:
Note: targeted ESLint on this repo currently reports pre-existing functional/class-rule errors in
src/classes/Mempool.tsand a parser project inclusion error forsrc/__tests__/mempool.test.ts; these are unrelated to this endpoint change. The focused Jest regression, full Jest suite, build, and diff check pass.Bounty context: Bitgesell PR bounty/improvement program.