-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support xfield for rust-tapyrus #11
Conversation
8247c55
to
0c3a1da
Compare
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.
Regarding logic and structure changes are pretty good. 👍
But, I think the field name should be xfield
and xfieldType
for consistency.
What do you think?
src/blockdata/block.rs
Outdated
|
||
/// An extra field that allows the block header to hold arbitrary data. | ||
#[derive(Clone, Debug, Eq, PartialEq)] | ||
pub enum ExtraField { |
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.
👍
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.
Fixed at b15ff3e
src/blockdata/block.rs
Outdated
#[cfg(feature = "serde")] | ||
impl<'de> ::serde::Deserialize<'de> for ExtraField { | ||
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<ExtraField, D::Error> { | ||
struct ExtraFieldVisitor; |
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.
👍 I didn't know that we can define structs in a function.
This pull request will add an extra field feature proposed at chaintope/tapyrus-core#66
and a part of solution of the support tapyrus v0.4.0