Skip to content

Add missing return fields in v20 and v21#267

Merged
tcharding merged 5 commits intorust-bitcoin:masterfrom
jamillambert:0618-v21-missing-fields
Jun 25, 2025
Merged

Add missing return fields in v20 and v21#267
tcharding merged 5 commits intorust-bitcoin:masterfrom
jamillambert:0618-v21-missing-fields

Conversation

@jamillambert
Copy link
Collaborator

@jamillambert jamillambert commented Jun 23, 2025

Some of the types in v20 and v21 had missing return fields.

For each of the following RPCs that were missing a return field in v20 or v21 check for further changes up to v29 and implement them:

  • createmultisig
  • getblockchaininfo
  • getmempoolinfo
  • getnetworkinfo
  • getpeerinfo

Add all of the missing fields update the models, into function and reexports accordingly. Redefinitions of the types and into functions are modified copies of the most recent version of the RPC that had fields added.

Run the formatter in a separate commit to make the changes to the reexports easier to review.

@jamillambert jamillambert marked this pull request as draft June 23, 2025 15:15
@tcharding
Copy link
Member

Right to rebase now mate.

One of the methods, `createmultisig` was missing a field in v20. It is
missing another field in v23.

Add all of the missing fields and update the models, into function
and reexports accordingly.

Redefinitions of the types and into functions are copies of the v17
versions with the missing field added.
v21, v23 and v28 had missing return fields.

Redefine the type and into functions with the missing fields in v21 and
v23, add to existing definition in v28.

Update other into functions.
v21, v22 and v24 had missing return fields.

Redefine the type and into functions with the missing fields.

Update model and other into functions.
getnetworkinfo had missing fields in v21 and v28.

getpeerinfo had missing fields in multiple versions.

Redefine the types with the missing fields.  Add the fields to the
`GetNetworkInfo` model and update the into functions. Update the
reexports.
Reordering of the reexports alphabetically, no other changes.
@jamillambert jamillambert force-pushed the 0618-v21-missing-fields branch from bba39eb to 51ebe64 Compare June 24, 2025 07:04
@jamillambert
Copy link
Collaborator Author

Rebased. Didn't even get a merge conflict in the reexports. Score!

@jamillambert jamillambert marked this pull request as ready for review June 24, 2025 07:05
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 51ebe64

@tcharding tcharding merged commit face30a into rust-bitcoin:master Jun 25, 2025
29 checks passed
@tcharding
Copy link
Member

tcharding commented Jun 25, 2025

BOOM! Good effort man, turn the crank.

tcharding added a commit that referenced this pull request Jun 28, 2025
…d for

16ae504 Add serde(deny_unknown_fileds) (Jamil Lambert, PhD)
6dcf4c3 Fix comment and derive order for method (Jamil Lambert, PhD)
e84d8e9 Reorder derives to be the same (Jamil Lambert, PhD)

Pull request description:

  If there are missing return fields in the types structs the integration tests still pass.

  All of the missing fields have been added in #243, #251, #255, #267 and #272.

  The solution suggested in issue #241 is adding `#[serde(deny_unknown_fields)]` to each struct which makes the test fail if there are fields returned that are not in the struct.

  - First two patches: do a small code reorganisation to make sure the third patch that uses a search and replace catches all cases.
  - Third patch: add `#[serde(deny_unknown_fields)]` to all structs in `types` that derive `Serialize` and therefore use serde. Using a search and replace.

  Closes #241

ACKs for top commit:
  tcharding:
    ACK 16ae504

Tree-SHA512: 5e898edb3b1ce9a05cd3c576b71caf9f96a2cd0f29660a480f6d5775d682fb277665c013cb52c986d90d37f36c5bc320139d351ffc29e1a755d72d11ad185c4f
blaze-smith470pm added a commit to blaze-smith470pm/corepc that referenced this pull request Sep 26, 2025
51ebe64b4116c49e840a958e4cf20b05229ab2c6 Run the formatter (Jamil Lambert, PhD)
4c32f0954a166b28fe0b48acae9e1c60fcc9c243 Add missing fields to getnetworkinfo, getpeerinfo (Jamil Lambert, PhD)
56ffb4ffe5ecc21e47003843e28aac046903e8d6 Add missing fields to getmempoolinfo (Jamil Lambert, PhD)
0e97a48c16f88c74a0e23b47df96215eafd10544 Add missing fields to getblockchaininfo (Jamil Lambert, PhD)
d65d26c74d7fa0aa14bce9f101cccea08461685a Add missing return fields to createmultisig (Jamil Lambert, PhD)

Pull request description:

  Some of the types in v20 and v21 had missing return fields.

  For each of the following RPCs that were missing a return field in v20 or v21 check for further changes up to v29 and implement them:

  -  `createmultisig`
  - `getblockchaininfo`
  - `getmempoolinfo`
  - `getnetworkinfo`
  - `getpeerinfo`

  Add all of the missing fields update the models, into function and reexports accordingly. Redefinitions of the types and into functions are modified copies of the most recent version of the RPC that had fields added.

  Run the formatter in a separate commit to make the changes to the reexports easier to review.

ACKs for top commit:
  tcharding:
    ACK 51ebe64b4116c49e840a958e4cf20b05229ab2c6

Tree-SHA512: c24cd5eea554e01fa78aad4fdbafc2206ad3b0999b8f5e45b984c3900e7e6e8a49638972803318793fb450c8fbfa400a007a756da425f39efe84334404e2ca8c
@jamillambert jamillambert deleted the 0618-v21-missing-fields branch December 29, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants