mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
tests: Test for expected return values when calling functions returning a success code
This commit is contained in:
@@ -156,8 +156,8 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
|
||||
CScript p2wpkh_scriptPubKey = GetScriptForWitness(p2pkh_scriptPubKey);
|
||||
|
||||
CBasicKeyStore keystore;
|
||||
keystore.AddKey(coinbaseKey);
|
||||
keystore.AddCScript(p2pk_scriptPubKey);
|
||||
BOOST_CHECK(keystore.AddKey(coinbaseKey));
|
||||
BOOST_CHECK(keystore.AddCScript(p2pk_scriptPubKey));
|
||||
|
||||
// flags to test: SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY, SCRIPT_VERIFY_CHECKSEQUENCE_VERIFY, SCRIPT_VERIFY_NULLDUMMY, uncompressed pubkey thing
|
||||
|
||||
@@ -314,7 +314,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
|
||||
|
||||
// Sign
|
||||
SignatureData sigdata;
|
||||
ProduceSignature(keystore, MutableTransactionSignatureCreator(&valid_with_witness_tx, 0, 11*CENT, SIGHASH_ALL), spend_tx.vout[1].scriptPubKey, sigdata);
|
||||
BOOST_CHECK(ProduceSignature(keystore, MutableTransactionSignatureCreator(&valid_with_witness_tx, 0, 11*CENT, SIGHASH_ALL), spend_tx.vout[1].scriptPubKey, sigdata));
|
||||
UpdateInput(valid_with_witness_tx.vin[0], sigdata);
|
||||
|
||||
// This should be valid under all script flags.
|
||||
@@ -342,7 +342,7 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
|
||||
// Sign
|
||||
for (int i=0; i<2; ++i) {
|
||||
SignatureData sigdata;
|
||||
ProduceSignature(keystore, MutableTransactionSignatureCreator(&tx, i, 11*CENT, SIGHASH_ALL), spend_tx.vout[i].scriptPubKey, sigdata);
|
||||
BOOST_CHECK(ProduceSignature(keystore, MutableTransactionSignatureCreator(&tx, i, 11*CENT, SIGHASH_ALL), spend_tx.vout[i].scriptPubKey, sigdata));
|
||||
UpdateInput(tx.vin[i], sigdata);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user