In this PR, we fix a bug in RawTxInTaprootSignature that would cause
the function to not properly apply the sighash flag for non-default
sighash signatures. The logic would end up applying 0x00 as a mask,
which will always be 0x00 on the other end.
The RawTxInTapscriptSignature function was correct, though it had the
ordering switched as it applies the sighash if the type doesn't equal
default.
The second commit adds tests that fail w/o the first commit. Without
the first commit, the test fails for the keyspend sigs as they're always
64 bytes, since the sighash wasn't added for non-default types.
In this PR, we fix a bug in RawTxInTaprootSignature that would cause the function to not properly apply the sighash flag for non-default sighash signatures. The logic would end up applying
0x00
as a mask, which will always be0x00
on the other end.The RawTxInTapscriptSignature function was correct, though it had the ordering switched as it applies the sighash if the type doesn't equal default.
The second commit adds tests that fail w/o the first commit. Without the first commit, the test fails for the keyspend sigs as they're always 64 bytes, since the sighash wasn't added for non-default types.