Skip to content
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

Merged
merged 7 commits into from
Jun 1, 2020
Merged

Conversation

Yamaguchi
Copy link
Contributor

@Yamaguchi Yamaguchi commented Apr 16, 2020

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

@Yamaguchi Yamaguchi requested a review from rantan April 16, 2020 11:08
@Yamaguchi Yamaguchi changed the title Feature/xfield Support xfield for rust-tapyrus Apr 16, 2020
Copy link
Contributor

@rantan rantan left a 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?


/// An extra field that allows the block header to hold arbitrary data.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ExtraField {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed at b15ff3e

#[cfg(feature = "serde")]
impl<'de> ::serde::Deserialize<'de> for ExtraField {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<ExtraField, D::Error> {
struct ExtraFieldVisitor;
Copy link
Contributor

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.

@Yamaguchi Yamaguchi requested a review from rantan May 11, 2020 12:08
@rantan rantan merged commit 4eb3665 into chaintope:master Jun 1, 2020
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