mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
refactor: move SignSignature helpers to test utils
These helpers haven't been used in production code since segwit was
merged more than eight years ago (see commit 605e8473, PR #8149),
so it seems appropriate to move them to the test utils module.
Can be reviewed via `--color-moved=dimmed-zebra`.
This commit is contained in:
@@ -694,27 +694,6 @@ void SignatureData::MergeSignatureData(SignatureData sigdata)
|
||||
signatures.insert(std::make_move_iterator(sigdata.signatures.begin()), std::make_move_iterator(sigdata.signatures.end()));
|
||||
}
|
||||
|
||||
bool SignSignature(const SigningProvider &provider, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType, SignatureData& sig_data)
|
||||
{
|
||||
assert(nIn < txTo.vin.size());
|
||||
|
||||
MutableTransactionSignatureCreator creator(txTo, nIn, amount, nHashType);
|
||||
|
||||
bool ret = ProduceSignature(provider, creator, fromPubKey, sig_data);
|
||||
UpdateInput(txTo.vin.at(nIn), sig_data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SignSignature(const SigningProvider &provider, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType, SignatureData& sig_data)
|
||||
{
|
||||
assert(nIn < txTo.vin.size());
|
||||
const CTxIn& txin = txTo.vin[nIn];
|
||||
assert(txin.prevout.n < txFrom.vout.size());
|
||||
const CTxOut& txout = txFrom.vout[txin.prevout.n];
|
||||
|
||||
return SignSignature(provider, txout.scriptPubKey, txTo, nIn, txout.nValue, nHashType, sig_data);
|
||||
}
|
||||
|
||||
namespace {
|
||||
/** Dummy signature checker which accepts all signatures. */
|
||||
class DummySignatureChecker final : public BaseSignatureChecker
|
||||
|
||||
Reference in New Issue
Block a user