Skip to content

Conversation

@jamillambert
Copy link
Collaborator

@jamillambert jamillambert commented Jul 29, 2025

Go through all the TODO in the v26 types table. Add all the missing RPCs.

  • Move the blockchain module to a subdirectory with separate into.rs and error.rs files in preparation for adding the new RPCs. Code move only.
  • Add dumptxoutset method, model and test. An extra required (help says optional) argument was added in v29, update the client macro and test.
  • Add loadtxoutset method and model. It was not possible to test this, opened Issue How to test loadtxoutset? #313.
  • Add getchainstates method, model and test. Extra return fields added in v29, redefine the struct and into_model fn.
  • Implement importmempool method and test. Returns an empty json object, add the client macro and test.
  • Redefine getprioritisedtransactions. Add the extra return field in v27. Also change the model so that the fee_delta is an Amount.
  • Add getaddrmaninfo struct and test. Was marked as having a model, but nothing to model. Update the types table.
  • Run the formatter.

/// nBits: compact representation of the block difficulty target.
pub bits: Option<String>, // v29 and later only.
/// The difficulty target.
pub target: Option<String>, // v29 and later only.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub target: Option<String>, // v29 and later only.
pub target: Option<Target>, // v29 and later only.

In 91a0e2f

Grep for 'target: ' to see other instances of this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/// Blockhash of the tip.
pub best_block_hash: BlockHash,
/// nBits: compact representation of the block difficulty target.
pub bits: Option<String>, // v29 and later only.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub bits: Option<String>, // v29 and later only.
pub bits: Option<CompactTarget>, // v29 and later only.

In 91a0e2f

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,58 @@
// SPDX-License-Identifier: CC0-1.0

//! The JSON-RPC API for Bitcoin Core `v0.17` - mining.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cut'n pasta error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@tcharding
Copy link
Member

reviewed 8a78259

@jamillambert
Copy link
Collaborator Author

Suggested changes made.

@jamillambert jamillambert marked this pull request as ready for review July 30, 2025 08:11
tcharding
tcharding previously approved these changes Jul 31, 2025
Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 933ae97

@tcharding
Copy link
Member

ooph sorry mate, needs rebase because I merged #310

In preparation for adding new blockchain RPCs move the module to a
subdirectory and split out `error` and `into` into modules.

Code move only, no functional changes.
Add the struct, model, error, into_model fn and test.

Update verify to new_modelled since it has a model.

Add the reexports and update the types table.
Add the struct, model, error and into_model fn.

Update verify to new_modelled since it has a model.

Add the reexports and update the types table.

Loading the txoutset is not possible with the current node setup and it
has been left untested.
Add the struct, model, error, into_model fn and test.

Add the reexports and update the types table.
importmempool returns an empty json object. Create a client macro and
test for it.

Update the types table and verify to returns nothing.
getprioritisedtransactions adds an extra return field in v27.

Redefine the struct in v27.

Update the model to use the new field and also make `fee_delta` an
`Amount`.
Add the `getaddrmaninfo` struct, macro and test. Update the reexports.

There is no required model. Update the types table to `version` only.
Reordering of the reexports alphabetically only. No functional changes.
@jamillambert
Copy link
Collaborator Author

Rebased

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cb12454

@tcharding tcharding merged commit bbd3d56 into rust-bitcoin:master Jul 31, 2025
30 checks passed
blaze-smith470pm added a commit to blaze-smith470pm/corepc that referenced this pull request Sep 26, 2025
cb124545070cfdcdd2fd8534aecb970c924e471c Run the formatter (Jamil Lambert, PhD)
37b08219ff771e2110c9832b1196b1012adb7854 Add getaddrmaninfo struct and test (Jamil Lambert, PhD)
9ee00e0884e7cd6ab9c38abb390c4679aeff56cf Redefine getprioritisedtransactions (Jamil Lambert, PhD)
e163f934be9cedda600c6f9f18715109808e2651 Implement importmempool method and test (Jamil Lambert, PhD)
90df558a57412e19f800cee1408be4cd519c5d27 Add getchainstates method, model and test (Jamil Lambert, PhD)
0d7f6cea380e2bb697c4b123309cacbc8d2e2c39 Add loadtxoutset method and model (Jamil Lambert, PhD)
6f5145d043c31179b905a2c6e38904c5f5e522d5 Add dumptxoutset method, model and test (Jamil Lambert, PhD)
c891dc957f9def8c6f58800749543ffeaebfa39b Move v26 blockchain to subdirectory (Jamil Lambert, PhD)

Pull request description:

  Go through all the TODO in the v26 types table. Add all the missing RPCs.

  - Move the blockchain module to a subdirectory with separate `into.rs` and `error.rs` files in preparation for adding the new RPCs. Code move only.
  - Add `dumptxoutset` method, model and test. An extra required (help says optional) argument was added in v29, update the client macro and test.
  - Add `loadtxoutset` method and model. It was not possible to test this, opened Issue #313.
  - Add `getchainstates` method, model and test.  Extra return fields added in v29, redefine the struct and into_model fn.
  - Implement `importmempool` method and test. Returns an empty json object, add the client macro and test.
  - Redefine getprioritisedtransactions. Add the extra return field in v27. Also change the model so that the `fee_delta` is an `Amount`.
  - Add getaddrmaninfo struct and test. Was marked as having a model, but nothing to model. Update the types table.
  - Run the formatter.

ACKs for top commit:
  tcharding:
    ACK cb124545070cfdcdd2fd8534aecb970c924e471c

Tree-SHA512: 2d8b98329cb629552c7747c503a9ec494a4011867782c96ab01bd1e6dd2c53b55da0d37b978ebf7a07e184e8c0dd455c02119545be83270ae1cbc56b514f6eb7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants