Skip to content

Ensure missing return fields from types structs are tested for #273

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 3 commits into from
Jun 28, 2025

Conversation

jamillambert
Copy link
Collaborator

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

A few structs had a different order of the derives. These were missed in
a search and replace for all structs that had `Serialize` and therefore
`serde` when adding `#[serde(deny_unknown_fields)]`.

Reorder the derives to be the same as everywhere else.
There was a blank line and then a comment after the derive.

Fix it so that the comment is before the derive and there is no blank
line.
Add `#[serde(deny_unknown_fields)]` to all structs in `types` that
derive `Serialize` and therefore use serde. Using a search and replace.
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 16ae504

@tcharding tcharding merged commit 9dcc9c5 into rust-bitcoin:master Jun 28, 2025
29 checks passed
@tcharding
Copy link
Member

BOOM!

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.

Missing fields in types structs not tested
2 participants