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
Add special human-readable serde for OutPoint and most bip32 types #271
Conversation
74de3c2
to
ebe6ace
Compare
This is great. Can you make an analogous PR to rust-elements? |
I think we should first get rid of the serde macros. They aren't needed since rustc 0.15. |
Eh, actually there's no reason to get rid of the serde macros yet. ACK mod nit. |
Were you talking about using derive for the struct macro? |
I addressed the |
Btw, any idea if it's possible to condense that macro in the two other macros? It's kind of a total code duplicate of |
Yeah, No, I don't have any good ideas about how to reduce code duplication :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
I'm not too familiar with serde, but I can attest that:
If anyone can attest to the serde code in ebe6ace that'd be great. |
1ecc696
to
b59aedf
Compare
You should be able to see that it's nothing more than the other two serde impl macros combined with an |
b59aedf
to
2f51564
Compare
Fixed Rust v1.22 compilation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK
2f51564
to
2c2d55d
Compare
Added small commit to address @dongcarl 's nit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As was the case prior to rust-bitcoin/rust-bitcoin#271
This reduces the usage of real cryptography in --cfg=fuzzing, specifically replacing the secret->public key derivation with a simple copy and ECDH with XOR of the public and private parts (plus a stream of 1s to make a test pass that expected non-0 output). It leaves secret tweak addition/multiplication as-is. It also changes the context creation to over-allocate and store the context flags at the end of the context buffer, allowing us to easily test context flags in each function. While it would be nice to have something fancier (eg XOR-based), its not immediately obvious how to accomplish this, and better to fix the issues I have than spend too much time on it. Fixes rust-bitcoin#271. This partially reverts b811ec1
Serialized OutPoint as
"<txid>:<vout>"
instead of a struct when a human-readable (de)serializer is used, f.e. JSON.It should be noted that this is a breaking change for people relying on the current JSON serialization of OutPoint as a struct.
This PR is on top of #269, but doesn't have to be.
Closes #202.