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
Separate out bitcoinconsensus validation code #1912
Separate out bitcoinconsensus validation code #1912
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.
ACK bf20993
Could that have been in a separate commit? Seems like it could be easier to read/review if it was a few commits. |
Yep sure thing, I can do that. Thanks for the review! |
d085d61
to
222cb0c
Compare
The error changes are now separate. The final patch is just splitting the bitcoinconsenus code out to the new |
de1ba99
to
467d4bc
Compare
review checkpoint 467d4bc |
467d4bc
to
ea79465
Compare
Fixed review suggestions and also simplified the |
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.
ACK ea79465
Rebased on master (to pick up #1927). No other changes. |
ea79465
to
a9d5761
Compare
@stevenroose can we get an ack/nack please (since this was your work originally). |
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.
ACK a9d5761
a9d5761
to
779ba7a
Compare
Rebase only, no other changes. |
Add a comment to point users towards the `bitcoinconsensus-std` feature for std builds.
There is no need no nest the `bitcoinconsensus::Error` type within the `script::Error`, it is the only error type returned by the verify functions so just return it directly.
There is not need to return the general `script::Error` from the transaction verify functions. We can better describe the error path by returning a custom error.
This import is not used, our CI obviously does not warn for all feature combinations.
Pull all the code that depends on `bitcoinconsensus` out into a separate module `consensus::validation`. Leave transaction testing of bitcoinconsensus code in the transaction module.
779ba7a
to
dae2b50
Compare
Pulled master and rebased, woops. |
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.
ACK dae2b50
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
@stevenroose in future could you use the bitcoin core merge script to do merges? |
Pull all the code that depends on
bitcoinconsensus
out into a separate moduleconsensus::validation
.While we are at it clean up the error returns by making functions return error types specific to their needs instead of general error types. We still need the std error hack to implement
std::error::Error
ifbitcoinconsensus
feature is on but notbitcoinconsensus-std
.This is a re-spin of work done by @stevenroose in #330, things that are different:
bitcoinconsensus
type.