mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-02 03:46:01 +02:00
Removed implicit CTransaction constructor from tests
This commit is contained in:
@@ -102,7 +102,7 @@ static void BuildTxs(CMutableTransaction& spendingTx, CCoinsViewCache& coins, CM
|
||||
spendingTx.vout[0].nValue = 1;
|
||||
spendingTx.vout[0].scriptPubKey = CScript();
|
||||
|
||||
AddCoins(coins, creationTx, 0);
|
||||
AddCoins(coins, CTransaction(creationTx), 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
@@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
// is not accurate.
|
||||
assert(GetTransactionSigOpCost(CTransaction(creationTx), coins, flags) == MAX_PUBKEYS_PER_MULTISIG * WITNESS_SCALE_FACTOR);
|
||||
// Sanity check: script verification fails because of an invalid signature.
|
||||
assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
}
|
||||
|
||||
// Multisig nested in P2SH
|
||||
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
|
||||
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, CScriptWitness());
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2 * WITNESS_SCALE_FACTOR);
|
||||
assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
}
|
||||
|
||||
// P2WPKH witness program
|
||||
@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 1);
|
||||
// No signature operations if we don't verify the witness.
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags & ~SCRIPT_VERIFY_WITNESS) == 0);
|
||||
assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_EQUALVERIFY);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_EQUALVERIFY);
|
||||
|
||||
// The sig op cost for witness version != 0 is zero.
|
||||
assert(scriptPubKey[0] == 0x00);
|
||||
@@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
|
||||
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 1);
|
||||
assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_EQUALVERIFY);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_EQUALVERIFY);
|
||||
}
|
||||
|
||||
// P2WSH witness program
|
||||
@@ -209,7 +209,7 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2);
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags & ~SCRIPT_VERIFY_WITNESS) == 0);
|
||||
assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
}
|
||||
|
||||
// P2WSH nested in P2SH
|
||||
@@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
|
||||
|
||||
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
|
||||
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2);
|
||||
assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
assert(VerifyWithFlag(CTransaction(creationTx), spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user