Skip to content

Add address field for GetRawTransactionResultVoutScriptPubKey #263

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 1 commit into from
Dec 5, 2022

Conversation

thesimplekid
Copy link
Contributor

@thesimplekid thesimplekid commented Dec 5, 2022

Adds address field for support in bitcoin core 22 and later since addresses is deprecated. Keeps addresses field for backwards compatibility as mentioned in #214

@thesimplekid thesimplekid changed the title Add address field Add address field for GetRawTransactionResultVoutScriptPubKey Dec 5, 2022
@apoelstra
Copy link
Member

Looks good, but I'd change the Option<Vec> to just a Vec, and I think in either case you need to add #[serde(default)] to make it parse when the field is missing. (With a bare Vec, if the field is missing the user will get an empty vector, which I think is a bit easier to check for than unwrapping an option.)

@thesimplekid
Copy link
Contributor Author

You're right do need #[serde(default)], added.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 9023cce

@apoelstra apoelstra merged commit bdc9f9b into rust-bitcoin:master Dec 5, 2022
@thesimplekid thesimplekid deleted the ScriptPubKey branch December 9, 2022 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants