revault / revaultd

The "wallet" daemon for participants under the Revault architecture
BSD 3-Clause "New" or "Revised" License
48 stars 21 forks source link

`sighash_type` made explicit along with a bump in `bitcoind` version for CI testing #415

Closed Zshan0 closed 2 years ago

Zshan0 commented 2 years ago

Since the Bitcoin Core ignores the sighash type specified inside the PSBT inputs, sign_psbt relied on the default value of sighash_type which aligned with our requirements. https://github.com/bitcoin/bitcoin/pull/22514 changed the default value from SIGHASH_ALL to SIGHASH_DEFAULT. Making sighash_type explicit fixes the minor breaking change caused by the update in the bitcoin wallet. Note that since sighashtype parameter comes after the sign parameter, the value of sign has been set to the default value, true.

Along with the fix, bitcoind version used in CI has been bumped from 22.0 to 23.0.

This issue closes #414.

Zshan0 commented 2 years ago

Keeping the sighash_type as SigHashType::All was throwing an error:

Error while updating tip: \'Bitcoind server error: RPC error response: RpcError { code: -1, message: "SIGHASH_ALL is not a valid sighash parameter.", data: None }\''

After looking at cljdocs I changed the value to "ALL" and the tests passed locally. I was not able to find the correct Macro for it, please let me know if there are any more changes required.