-
Notifications
You must be signed in to change notification settings - Fork 990
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
Build block header from pre pow data and proof #3178
Conversation
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.
Thank you very much @austinabell! Looking good to me 👍
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.
This looks great!
One comment related to the automatic From
error conversion.
) -> Result<Self, Error> { | ||
// Convert hex pre pow string | ||
let mut header_bytes = from_hex(pre_pow) | ||
.map_err(|e| Error::Serialization(ser::Error::HexError(e.to_string())))?; |
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.
Looks good. Thanks!
Couple notes about the changes:
String
although there is no need for it to be mutable in this function.&str
since that does not need to be mutable either as it is just reading (that function is the main reason I kept as String, because it would just be converted back to a String anyway)