refactor: use SignOptions for SignTransaction

This commit is contained in:
Sjors Provoost
2025-07-04 16:46:49 +02:00
parent dc4a5d1270
commit 5ed41752c5
9 changed files with 18 additions and 13 deletions

View File

@@ -68,7 +68,7 @@ static void SignTransactionSingleInput(benchmark::Bench& bench, InputType input_
const CScript& prev_spk = prev_spks[(iter++) % prev_spks.size()];
coins[prevout] = Coin(CTxOut(10000, prev_spk), /*nHeightIn=*/100, /*fCoinBaseIn=*/false);
std::map<int, bilingual_str> input_errors;
bool complete = SignTransaction(tx, &keystore, coins, SIGHASH_ALL, input_errors);
bool complete = SignTransaction(tx, &keystore, coins, {.sighash_type = SIGHASH_ALL}, input_errors);
assert(complete);
});
}

View File

@@ -77,7 +77,8 @@ static void VerifyScriptBench(benchmark::Bench& bench, ScriptType script_type)
{txSpend.vin[0].prevout, Coin(txCredit.vout[0], /*nHeightIn=*/100, /*fCoinBaseIn=*/false)}
};
std::map<int, bilingual_str> input_errors;
assert(SignTransaction(txSpend, &keystore, coins, SIGHASH_ALL, input_errors));
bool complete = SignTransaction(txSpend, &keystore, coins, {.sighash_type = SIGHASH_ALL}, input_errors);
assert(complete);
// Weak sanity check on witness data to ensure we produced the intended spending type
assert(txSpend.vin[0].scriptWitness.stack.size() == ExpectedWitnessStackSize(script_type));
txdata.Init(txSpend, /*spent_outputs=*/{txCredit.vout[0]});