mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
refactor: use SignOptions for SignTransaction
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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]});
|
||||
|
||||
Reference in New Issue
Block a user