Skip to content

Add missing return fields in v20 and v21 #267

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
merged 5 commits into from
Jun 25, 2025

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
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