From: Steve Myers Date: Tue, 25 Jun 2024 19:15:12 +0000 (-0500) Subject: Merge bitcoindevkit/bdk#1424: Remove trait ComputeSighash X-Git-Tag: v1.0.0-beta.1~13 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.SegwitCodeLengthError.html?a=commitdiff_plain;h=275e069cf45ec13a59225043ecac399986f6ca26;p=bdk Merge bitcoindevkit/bdk#1424: Remove trait ComputeSighash 55a17293a455435c868f60f0c9f06ba80f2f0e4c ref(signer): Use `Psbt::sighash_ecdsa` for computing sighashes (valued mammal) f2a2dae84cd04df4301f91745efa137975eeb8e4 refactor(signer): Remove trait ComputeSighash (valued mammal) Pull request description: This PR does some cleanup of the `bdk_wallet` signer module most notably by removing the internal trait `ComputeSighash` and replacing old code for computing the sighash (for legacy and segwit context) with a single method [`Psbt::sighash_ecdsa`](https://docs.rs/bitcoin/0.31.2/bitcoin/psbt/struct.Psbt.html#method.sighash_ecdsa). The logic for computing the taproot sighash is unchanged and extracted to a new helper function `compute_tap_sighash`. - [x] Unimplement `ComputeSighash` - [x] Try de-duplicating code by using `Psbt::sighash_ecdsa`. see https://github.com/bitcoindevkit/bdk/pull/1023#discussion_r1263140218 - Not done in this PR: Consider removing unused `SignerError` variants fixes #1038 ### Notes to the reviewers ### Changelog notice ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing Top commit has no ACKs. Tree-SHA512: 56af3c9c463513ca3bae5480aa5b90d78de119c3c09c824a7220eb6832d5f403b172afc8168228918ea1adabb4bf8fca858790adfebf84fc334b4fc1cc99d3cd --- 275e069cf45ec13a59225043ecac399986f6ca26