Skip to content

Derive serde::Serialize for GetTransactionResultDetail et al #250

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

Conversation

casey
Copy link
Contributor

@casey casey commented Oct 5, 2022

We're implementing get_transaction for our dummy Bitcoin RPC server, and we need to construct and return a GetTransactionResultDetail, but GetTransactionResultDetail doesn't implement Serialize. This PR derives Serialize for GetTransactionResultDetail, as well as the types it contains.

@casey casey force-pushed the serialize-get-transaction-result-detail-et-al branch 2 times, most recently from 3aa5b67 to 1cac120 Compare October 5, 2022 19:12
@casey
Copy link
Contributor Author

casey commented Oct 20, 2022

Just added derive(Serialize) to GetBalanceResult and GetBalanceResultEntry. Also, friendly ping if someone could take a look at this that would be awesome

@gruve-p
Copy link

gruve-p commented Mar 26, 2023

@casey Can you update this PR to include ordinals#5 ?
@apoelstra Can this and #288 be merged so https://github.com/casey/ord/issues/1295 can be closed?

@nammaki
Copy link

nammaki commented Mar 26, 2023

Looks clean and simple to me 🚀

@apoelstra
Copy link
Member

apoelstra commented Mar 27, 2023

Not sure why CI didn't run on this -- but cargo +nightly fmt --check doesn't pass on this. Can you re-format?

@tcharding
Copy link
Member

tcharding commented Oct 30, 2023

The formatting is unrelated to this PR. Fixed in #314 ... but MSRV is broken. Maybe fixed in #315

@casey casey force-pushed the serialize-get-transaction-result-detail-et-al branch 4 times, most recently from af28628 to 1cac120 Compare November 9, 2023 01:54
@casey casey force-pushed the serialize-get-transaction-result-detail-et-al branch from 1cac120 to d85da1d Compare November 9, 2023 01:58
@casey
Copy link
Contributor Author

casey commented Nov 9, 2023

We ran into a few other types that we needed Serialize/Deserialize implementations for. I thought that it probably isn't a good idea to add implementations piecemeal, and that all the API types should support Serialize and Deserialize if possible. I derived Serialize and Deserialize for all API types, skipping a couple where a field didn't support serialize or deserialize.

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 d85da1d

@tcharding tcharding merged commit 33293a5 into rust-bitcoin:master Apr 30, 2024
@casey casey deleted the serialize-get-transaction-result-detail-et-al branch May 1, 2024 00:36
@casey
Copy link
Contributor Author

casey commented May 1, 2024

Nice, thank you for the merge!

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.

5 participants