-
Notifications
You must be signed in to change notification settings - Fork 49
Add testmempoolaccept test and update structs
#327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tcharding
merged 3 commits into
rust-bitcoin:master
from
jamillambert:0812-testmempoolaccept
Aug 13, 2025
Merged
Add testmempoolaccept test and update structs
#327
tcharding
merged 3 commits into
rust-bitcoin:master
from
jamillambert:0812-testmempoolaccept
Aug 13, 2025
Conversation
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
The function gives a `TooPreciceError` if 1e-5 is passed to it, i.e. 1 Sat / vb, due to the imprecise calculation in base2 f64. Move the division to after the conversion to Sats to remove the rounding error.
Add a test for `testmempoolaccept` and implement all the changes to the returned fields in versions 21, 22, 25 and 29. Update the types table
Reordering of reexports only
tcharding
approved these changes
Aug 13, 2025
Member
tcharding
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7401356
spacebear21
added a commit
to spacebear21/rust-payjoin
that referenced
this pull request
Sep 5, 2025
bitcoind is no longer maintained and is incompatible with newer versions of Bitcoin Core. corepc-node is the "official" successor (see deprecation notice on https://docs.rs/bitcoind/latest/bitcoind/). However, the the latest tagged release for corepc_node as of writing (0.8.0) contains several bugs when deserializing the [testmempoolaccept](rust-bitcoin/corepc#327), [walletprocesspsbt](rust-bitcoin/corepc#340), and [finalizepsbt](rust-bitcoin/corepc#326) RPC responses. The linked PRs fixed those issues, but haven't been included in a release yet. For now we can point to a specific git rev from https://github.com/rust-bitcoin/corepc to make those fixes available.
spacebear21
added a commit
to spacebear21/rust-payjoin
that referenced
this pull request
Sep 5, 2025
bitcoind is no longer maintained and is incompatible with newer versions of Bitcoin Core. corepc-node is the "official" successor (see deprecation notice on https://docs.rs/bitcoind/latest/bitcoind/). However, the the latest tagged release for corepc_node as of writing (0.8.0) contains several bugs when deserializing the [testmempoolaccept](rust-bitcoin/corepc#327), [walletprocesspsbt](rust-bitcoin/corepc#340), and [finalizepsbt](rust-bitcoin/corepc#326) RPC responses. The linked PRs fixed those issues, but haven't been included in a release yet. For now we can point to a specific git rev from https://github.com/rust-bitcoin/corepc to make those fixes available.
blaze-smith470pm
added a commit
to blaze-smith470pm/corepc
that referenced
this pull request
Sep 26, 2025
…e structs
74013560445acc0efd3281969f1e587f0b100ec8 Run the formatter (jamillambert)
5f9d6f598ede852f3a427735fe117aa45069ad41 Add testmempoolaccept test and update structs (jamillambert)
60dbb35130110cad56d170d3497c4db47a1913f2 Fix rounding error in btc_per_kb (Jamil Lambert, PhD)
Pull request description:
`testmempoolaccept` is untested and missing return fields added in versions after v17.
The helper function `btc_per_kb` returned a `TooPreciseError` with 1e-5 `btc_per_kb` which should work. Due to the imprecise representation of 1e-5 in binary in f64, and when divided by 1000 and converting to sats results in 0.9999999999999998 not 1.0. Rounding is not possible since it will remove all occurances of `TooPreciseError`.
- Update `btc_per_kb` to do the division by 1000 after creating the `Amount` in sats.
- Add a test for `testmempoolaccept` and redefine the struct, model and into_model functions for changes in the RPC for all versions up to 29.
- Run the formatter
ACKs for top commit:
tcharding:
ACK 74013560445acc0efd3281969f1e587f0b100ec8
Tree-SHA512: 8d8c26bab040458e786620843e1305e19d79c612c930fd20afd307a68b750598d5142d44d696b46afd6ba94e6b877962a22faf393bf81a8a630d6cf62eaa4e5b
node-smithxby72w
added a commit
to node-smithxby72w/rust-payjoin
that referenced
this pull request
Sep 28, 2025
bitcoind is no longer maintained and is incompatible with newer versions of Bitcoin Core. corepc-node is the "official" successor (see deprecation notice on https://docs.rs/bitcoind/latest/bitcoind/). However, the the latest tagged release for corepc_node as of writing (0.8.0) contains several bugs when deserializing the [testmempoolaccept](rust-bitcoin/corepc#327), [walletprocesspsbt](rust-bitcoin/corepc#340), and [finalizepsbt](rust-bitcoin/corepc#326) RPC responses. The linked PRs fixed those issues, but haven't been included in a release yet. For now we can point to a specific git rev from https://github.com/rust-bitcoin/corepc to make those fixes available.
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.
testmempoolacceptis untested and missing return fields added in versions after v17.The helper function
btc_per_kbreturned aTooPreciseErrorwith 1e-5btc_per_kbwhich should work. Due to the imprecise representation of 1e-5 in binary in f64, and when divided by 1000 and converting to sats results in 0.9999999999999998 not 1.0. Rounding is not possible since it will remove all occurances ofTooPreciseError.btc_per_kbto do the division by 1000 after creating theAmountin sats.testmempoolacceptand redefine the struct, model and into_model functions for changes in the RPC for all versions up to 29.