Merge bitcoin/bitcoin#32958: wallet/refactor: Update SignPSBTInput to return util::Expected<void, PSBTError> and remove PSBTError:Ok

6cca38e2b9 refactor: remove unused PSBTError::Ok (kevkevinpal)
3660678b95 refactor: SignPSBTInput now uses util:Expected (kevkevinpal)

Pull request description:

  ### Description
  This is a follow-up to https://github.com/bitcoin/bitcoin/pull/31622#discussion_r2092030045 and https://github.com/bitcoin/bitcoin/pull/31622#discussion_r2092035407

  ### What this changes
  - Updates `SignPSBTInput` to return `util::Expected<void, PSBTError>`
  - Removes `PSBTError:Ok` from the `PSBTError` Enum

ACKs for top commit:
  achow101:
    ACK 6cca38e2b9
  rkrux:
    lgtm ACK 6cca38e2b9
  jeanpablojp:
    tACK 6cca38e2b9

Tree-SHA512: c83b2e7e440aff01becc788e36a732756085f507d447eaa16dd1276d0d0b54070d0d8a51727d553d214043935072586111a175f34338a8d1886a6d5b251de7e4
This commit is contained in:
Ava Chow
2026-08-20 14:13:21 -07:00
7 changed files with 28 additions and 25 deletions

View File

@@ -72,7 +72,8 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
// Figure out what is missing
SignatureData outdata;
bool complete = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, /*options=*/{}, &outdata) == PSBTError::OK;
const auto sign_result = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, /*options*/{}, &outdata);
bool complete = sign_result.has_value();
// Things are missing
if (!complete) {
@@ -130,7 +131,8 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
PSBTInput& input = psbtx.inputs[i];
Coin newcoin;
if (SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, nullptr, /*options=*/{}) != PSBTError::OK || !input.GetUTXO(newcoin.out)) {
const auto sign_result = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, nullptr, /*options=*/{});
if (!sign_result.has_value() || !input.GetUTXO(newcoin.out)) {
success = false;
break;
} else {