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
Introduce PsbtSigHashType #779
Introduce PsbtSigHashType #779
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.
A few minor suggestions :)
We do not want to imports from within the lib and external of lib in the same line
9aad350
to
ebdeed0
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.
ACK ebdeed0
I was a little hesitant about this PR, but I think it makes sense. The type of the sighash in PSBT is little more than a bytestring, and I think this is the right way to represent it in rust-bitcoin.
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 ebdeed0
Do not want to bikeshedd about method names, just left a note which can be applied only if there will be re-base or other updates
} | ||
|
||
/// Obtains the inner sighash byte from this [`PsbtSigHashType`]. | ||
pub fn inner(self) -> u32 { |
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.
nit: probably as_u32
will be better, because it is not clear what is the inner type for PSBT sighashes. Also inner
is quite uncommon, usually it is as_inner
or into_inner
.
Also as_u32
will match methods in EcdsaSigHashType
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.
Let's leave it for some of the follow-up PRs
Ok, I was the second reviewer, so I tested it on my machine with a test build script on each of the commits and merged. |
We cannot really use
Psbt
for taproot because the sighash type is currently EcdsaSigHashType. We could introduce an enum with two options but then deser is not really clear, so I chose the approach in the current PR. Feedback or other ways to do this welcome :)This is NOT related to #776