diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -243,60 +243,44 @@ } BOOST_AUTO_TEST_CASE(rpc_format_monetary_values) { - BOOST_CHECK(ValueFromAmount(0LL).write() == "0.00000000"); - BOOST_CHECK(ValueFromAmount(1LL).write() == "0.00000001"); - BOOST_CHECK(ValueFromAmount(17622195LL).write() == "0.17622195"); - BOOST_CHECK(ValueFromAmount(50000000LL).write() == "0.50000000"); - BOOST_CHECK(ValueFromAmount(89898989LL).write() == "0.89898989"); - BOOST_CHECK(ValueFromAmount(100000000LL).write() == "1.00000000"); - BOOST_CHECK(ValueFromAmount(2099999999999990LL).write() == + BOOST_CHECK(ValueFromAmount(Amount(0LL)).write() == "0.00000000"); + BOOST_CHECK(ValueFromAmount(Amount(1LL)).write() == "0.00000001"); + BOOST_CHECK(ValueFromAmount(Amount(17622195LL)).write() == "0.17622195"); + BOOST_CHECK(ValueFromAmount(Amount(50000000LL)).write() == "0.50000000"); + BOOST_CHECK(ValueFromAmount(Amount(89898989LL)).write() == "0.89898989"); + BOOST_CHECK(ValueFromAmount(Amount(100000000LL)).write() == "1.00000000"); + BOOST_CHECK(ValueFromAmount(Amount(2099999999999990LL)).write() == "20999999.99999990"); - BOOST_CHECK(ValueFromAmount(2099999999999999LL).write() == + BOOST_CHECK(ValueFromAmount(Amount(2099999999999999LL)).write() == "20999999.99999999"); - BOOST_CHECK_EQUAL(ValueFromAmount(0).write(), "0.00000000"); - BOOST_CHECK_EQUAL( - ValueFromAmount((COIN.GetSatoshis() / 10000) * 123456789).write(), - "12345.67890000"); - BOOST_CHECK_EQUAL(ValueFromAmount(-COIN.GetSatoshis()).write(), - "-1.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(-COIN.GetSatoshis() / 10).write(), - "-0.10000000"); - - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 100000000).write(), + BOOST_CHECK_EQUAL(ValueFromAmount(Amount(0)).write(), "0.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(123456789 * (COIN / 10000)).write(), + "12345.67890000"); + BOOST_CHECK_EQUAL(ValueFromAmount(-1 * COIN).write(), "-1.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(-1 * COIN / 10).write(), "-0.10000000"); + + BOOST_CHECK_EQUAL(ValueFromAmount(100000000 * COIN).write(), "100000000.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 10000000).write(), + BOOST_CHECK_EQUAL(ValueFromAmount(10000000 * COIN).write(), "10000000.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 1000000).write(), + BOOST_CHECK_EQUAL(ValueFromAmount(1000000 * COIN).write(), "1000000.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 100000).write(), + BOOST_CHECK_EQUAL(ValueFromAmount(100000 * COIN).write(), "100000.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 10000).write(), - "10000.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 1000).write(), - "1000.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 100).write(), - "100.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() * 10).write(), - "10.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis()).write(), - "1.00000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 10).write(), - "0.10000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 100).write(), - "0.01000000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 1000).write(), - "0.00100000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 10000).write(), - "0.00010000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 100000).write(), - "0.00001000"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 1000000).write(), - "0.00000100"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 10000000).write(), - "0.00000010"); - BOOST_CHECK_EQUAL(ValueFromAmount(COIN.GetSatoshis() / 100000000).write(), - "0.00000001"); + BOOST_CHECK_EQUAL(ValueFromAmount(10000 * COIN).write(), "10000.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(1000 * COIN).write(), "1000.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(100 * COIN).write(), "100.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(10 * COIN).write(), "10.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN).write(), "1.00000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 10).write(), "0.10000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 100).write(), "0.01000000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 1000).write(), "0.00100000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 10000).write(), "0.00010000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 100000).write(), "0.00001000"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 1000000).write(), "0.00000100"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 10000000).write(), "0.00000010"); + BOOST_CHECK_EQUAL(ValueFromAmount(COIN / 100000000).write(), "0.00000001"); } static UniValue ValueFromString(const std::string &str) { @@ -308,44 +292,47 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values) { BOOST_CHECK_THROW(AmountFromValue(ValueFromString("-0.00000001")), UniValue); - BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0")), 0LL); - BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000000")), 0LL); - BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000001")), 1LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0")), Amount(0LL)); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000000")), + Amount(0LL)); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000001")), + Amount(1LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.17622195")), - 17622195LL); - BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.5")), 50000000LL); + Amount(17622195LL)); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.5")), + Amount(50000000LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.50000000")), - 50000000LL); + Amount(50000000LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.89898989")), - 89898989LL); + Amount(89898989LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1.00000000")), - 100000000LL); + Amount(100000000LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("20999999.9999999")), - 2099999999999990LL); + Amount(2099999999999990LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("20999999.99999999")), - 2099999999999999LL); + Amount(2099999999999999LL)); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1e-8")), - COIN.GetSatoshis() / 100000000); + COIN / 100000000); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.1e-7")), - COIN.GetSatoshis() / 100000000); + COIN / 100000000); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.01e-6")), - COIN.GetSatoshis() / 100000000); + COIN / 100000000); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString( "0." "0000000000000000000000000000000000000000000000000000" "000000000000000000000001e+68")), - COIN.GetSatoshis() / 100000000); + COIN / 100000000); BOOST_CHECK_EQUAL( AmountFromValue(ValueFromString("10000000000000000000000000000000000000" "000000000000000000000000000e-64")), - COIN.GetSatoshis()); + COIN); BOOST_CHECK_EQUAL( AmountFromValue(ValueFromString( "0." "000000000000000000000000000000000000000000000000000000000000000100" "000000000000000000000000000000000000000000000000000e64")), - COIN.GetSatoshis()); + COIN); // should fail BOOST_CHECK_THROW(AmountFromValue(ValueFromString("1e-9")), UniValue); @@ -354,11 +341,11 @@ UniValue); // should pass, cut trailing 0 BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000001000000")), - 1LL); + Amount(1LL)); // should fail BOOST_CHECK_THROW(AmountFromValue(ValueFromString("19e-9")), UniValue); // should pass, leading 0 is present - BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.19e-6")), 19); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.19e-6")), Amount(19)); // overflow error BOOST_CHECK_THROW(AmountFromValue(ValueFromString("92233720368.54775808")), @@ -383,7 +370,7 @@ std::runtime_error); BOOST_CHECK_EQUAL(AmountFromValue(ParseNonRFCJSONValue( "0.00000000000000000000000000000000000001e+30 ")), - 1); + Amount(1)); // Invalid, initial garbage BOOST_CHECK_THROW(ParseNonRFCJSONValue("[1.0"), std::runtime_error); BOOST_CHECK_THROW(ParseNonRFCJSONValue("a1.0"), std::runtime_error); @@ -414,7 +401,7 @@ BOOST_CHECK_NO_THROW(CallRPC(std::string("setban 127.0.0.0 remove"))); BOOST_CHECK_NO_THROW(r = CallRPC(std::string("listbanned"))); ar = r.get_array(); - BOOST_CHECK_EQUAL(ar.size(), 0); + BOOST_CHECK_EQUAL(ar.size(), 0UL); BOOST_CHECK_NO_THROW( r = CallRPC(std::string("setban 127.0.0.0/24 add 1607731200 true"))); @@ -449,7 +436,7 @@ BOOST_CHECK_NO_THROW(CallRPC(std::string("setban 127.0.0.0/24 remove"))); BOOST_CHECK_NO_THROW(r = CallRPC(std::string("listbanned"))); ar = r.get_array(); - BOOST_CHECK_EQUAL(ar.size(), 0); + BOOST_CHECK_EQUAL(ar.size(), 0UL); BOOST_CHECK_NO_THROW( r = CallRPC(std::string("setban 127.0.0.0/255.255.0.0 add"))); @@ -459,7 +446,7 @@ BOOST_CHECK_NO_THROW(CallRPC(std::string("clearbanned"))); BOOST_CHECK_NO_THROW(r = CallRPC(std::string("listbanned"))); ar = r.get_array(); - BOOST_CHECK_EQUAL(ar.size(), 0); + BOOST_CHECK_EQUAL(ar.size(), 0UL); // invalid IP BOOST_CHECK_THROW(r = CallRPC(std::string("setban test add")), diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -36,14 +36,14 @@ txTo.vin[0].prevout.n = 0; txTo.vin[0].prevout.hash = txFrom.GetId(); txTo.vin[0].scriptSig = scriptSig; - txTo.vout[0].nValue = 1; - - return VerifyScript(scriptSig, scriptPubKey, - (fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE) | - SCRIPT_ENABLE_SIGHASH_FORKID, - MutableTransactionSignatureChecker( - &txTo, 0, txFrom.vout[0].nValue.GetSatoshis()), - &err); + txTo.vout[0].nValue = Amount(1); + + return VerifyScript( + scriptSig, scriptPubKey, + (fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE) | + SCRIPT_ENABLE_SIGHASH_FORKID, + MutableTransactionSignatureChecker(&txTo, 0, txFrom.vout[0].nValue), + &err); } BOOST_FIXTURE_TEST_SUITE(script_P2SH_tests, BasicTestingSetup) @@ -81,9 +81,9 @@ txFrom.vout.resize(8); for (int i = 0; i < 4; i++) { txFrom.vout[i].scriptPubKey = evalScripts[i]; - txFrom.vout[i].nValue = COIN.GetSatoshis(); + txFrom.vout[i].nValue = COIN; txFrom.vout[i + 4].scriptPubKey = standardScripts[i]; - txFrom.vout[i + 4].nValue = COIN.GetSatoshis(); + txFrom.vout[i + 4].nValue = COIN; } BOOST_CHECK(IsStandardTx(txFrom, reason)); @@ -93,7 +93,7 @@ txTo[i].vout.resize(1); txTo[i].vin[0].prevout.n = i; txTo[i].vin[0].prevout.hash = txFrom.GetId(); - txTo[i].vout[0].nValue = 1; + txTo[i].vout[0].nValue = Amount(1); BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i)); } @@ -111,11 +111,11 @@ CScript sigSave = txTo[i].vin[0].scriptSig; txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig; const CTxOut &output = txFrom.vout[txTo[i].vin[0].prevout.n]; - bool sigOK = CScriptCheck( - output.scriptPubKey, output.nValue.GetSatoshis(), txTo[i], 0, - SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | - SCRIPT_ENABLE_SIGHASH_FORKID, - false, txdata)(); + bool sigOK = + CScriptCheck(output.scriptPubKey, output.nValue, txTo[i], 0, + SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | + SCRIPT_ENABLE_SIGHASH_FORKID, + false, txdata)(); if (i == j) { BOOST_CHECK_MESSAGE(sigOK, strprintf("VerifySignature %d %d", i, j)); @@ -187,7 +187,7 @@ txFrom.vout.resize(4); for (int i = 0; i < 4; i++) { txFrom.vout[i].scriptPubKey = outer[i]; - txFrom.vout[i].nValue = CENT.GetSatoshis(); + txFrom.vout[i].nValue = CENT; } BOOST_CHECK(IsStandardTx(txFrom, reason)); @@ -198,7 +198,7 @@ txTo[i].vout.resize(1); txTo[i].vin[0].prevout.n = i; txTo[i].vin[0].prevout.hash = txFrom.GetId(); - txTo[i].vout[0].nValue = 1 * CENT.GetSatoshis(); + txTo[i].vout[0].nValue = 1 * CENT; txTo[i].vout[0].scriptPubKey = inner[i]; BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i)); @@ -330,13 +330,13 @@ // P2SH (OP_CHECKSIG) txFrom.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(pay1)); - txFrom.vout[0].nValue = 1000; + txFrom.vout[0].nValue = Amount(1000); // ordinary OP_CHECKSIG txFrom.vout[1].scriptPubKey = pay1; - txFrom.vout[1].nValue = 2000; + txFrom.vout[1].nValue = Amount(2000); // ordinary OP_CHECKMULTISIG txFrom.vout[2].scriptPubKey = pay1of3; - txFrom.vout[2].nValue = 3000; + txFrom.vout[2].nValue = Amount(3000); // vout[3] is complicated 1-of-3 AND 2-of-3 // ... that is OK if wrapped in P2SH: @@ -351,7 +351,7 @@ oneAndTwo << OP_3 << OP_CHECKMULTISIG; keystore.AddCScript(oneAndTwo); txFrom.vout[3].scriptPubKey = GetScriptForDestination(CScriptID(oneAndTwo)); - txFrom.vout[3].nValue = 4000; + txFrom.vout[3].nValue = Amount(4000); // vout[4] is max sigops: CScript fifteenSigops; @@ -362,7 +362,7 @@ keystore.AddCScript(fifteenSigops); txFrom.vout[4].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops)); - txFrom.vout[4].nValue = 5000; + txFrom.vout[4].nValue = Amount(5000); // vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS CScript sixteenSigops; @@ -370,13 +370,13 @@ keystore.AddCScript(sixteenSigops); txFrom.vout[5].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops)); - txFrom.vout[5].nValue = 5000; + txFrom.vout[5].nValue = Amount(5000); CScript twentySigops; twentySigops << OP_CHECKMULTISIG; keystore.AddCScript(twentySigops); txFrom.vout[6].scriptPubKey = GetScriptForDestination(CScriptID(twentySigops)); - txFrom.vout[6].nValue = 6000; + txFrom.vout[6].nValue = Amount(6000); AddCoins(coins, txFrom, 0); @@ -413,7 +413,7 @@ txToNonStd1.vout.resize(1); txToNonStd1.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID()); - txToNonStd1.vout[0].nValue = 1000; + txToNonStd1.vout[0].nValue = Amount(1000); txToNonStd1.vin.resize(1); txToNonStd1.vin[0].prevout.n = 5; txToNonStd1.vin[0].prevout.hash = txFrom.GetId(); @@ -427,7 +427,7 @@ txToNonStd2.vout.resize(1); txToNonStd2.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID()); - txToNonStd2.vout[0].nValue = 1000; + txToNonStd2.vout[0].nValue = Amount(1000); txToNonStd2.vin.resize(1); txToNonStd2.vin[0].prevout.n = 6; txToNonStd2.vin[0].prevout.hash = txFrom.GetId(); diff --git a/src/test/script_antireplay_tests.cpp b/src/test/script_antireplay_tests.cpp --- a/src/test/script_antireplay_tests.cpp +++ b/src/test/script_antireplay_tests.cpp @@ -85,7 +85,7 @@ tx.vin[0].prevout.n = 0; tx.vin[0].scriptSig = CScript(); tx.vout.resize(1); - tx.vout[0].nValue = 1; + tx.vout[0].nValue = Amount(1); tx.vout[0].scriptPubKey = CScript(); { diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -310,7 +310,7 @@ TestBuilder &PushSig(const CKey &key, int nHashType = SIGHASH_ALL, unsigned int lenR = 32, unsigned int lenS = 32, - Amount amount = 0) { + Amount amount = Amount(0)) { uint256 hash = SignatureHash(script, spendTx, 0, nHashType, amount); std::vector vchSig, r, s; uint32_t iter = 0; @@ -377,7 +377,7 @@ UniValue GetJSON() { DoPush(); UniValue array(UniValue::VARR); - if (nValue != 0) { + if (nValue != Amount(0)) { UniValue amount(UniValue::VARR); amount.push_back(ValueFromAmount(nValue)); array.push_back(amount); @@ -1026,7 +1026,7 @@ "P2PK INVALID AMOUNT", SCRIPT_ENABLE_SIGHASH_FORKID, false, TEST_AMOUNT) .PushSig(keys.key0, SIGHASH_ALL | SIGHASH_FORKID, 32, 32, - TEST_AMOUNT + 1) + TEST_AMOUNT + Amount(1)) .ScriptError(SCRIPT_ERR_EVAL_FALSE)); tests.push_back( TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, @@ -1084,7 +1084,7 @@ for (unsigned int idx = 0; idx < tests.size(); idx++) { UniValue test = tests[idx]; std::string strTest = test.write(); - Amount nValue = 0; + Amount nValue(0); unsigned int pos = 0; if (test.size() > 0 && test[pos].isArray()) { nValue = AmountFromValue(test[pos][0]); @@ -1150,7 +1150,8 @@ CScript sign_multisig(CScript scriptPubKey, std::vector keys, CTransaction transaction) { - uint256 hash = SignatureHash(scriptPubKey, transaction, 0, SIGHASH_ALL, 0); + uint256 hash = + SignatureHash(scriptPubKey, transaction, 0, SIGHASH_ALL, Amount(0)); CScript result; // @@ -1189,7 +1190,8 @@ << ToByteVector(key2.GetPubKey()) << OP_2 << OP_CHECKMULTISIG; - CMutableTransaction txFrom12 = BuildCreditingTransaction(scriptPubKey12, 0); + CMutableTransaction txFrom12 = + BuildCreditingTransaction(scriptPubKey12, Amount(0)); CMutableTransaction txTo12 = BuildSpendingTransaction(CScript(), txFrom12); CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12); @@ -1198,7 +1200,7 @@ MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); - txTo12.vout[0].nValue = 2; + txTo12.vout[0].nValue = Amount(2); BOOST_CHECK(!VerifyScript( goodsig1, scriptPubKey12, flags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), @@ -1234,7 +1236,8 @@ << ToByteVector(key3.GetPubKey()) << OP_3 << OP_CHECKMULTISIG; - CMutableTransaction txFrom23 = BuildCreditingTransaction(scriptPubKey23, 0); + CMutableTransaction txFrom23 = + BuildCreditingTransaction(scriptPubKey23, Amount(0)); CMutableTransaction txTo23 = BuildSpendingTransaction(CScript(), txFrom23); std::vector keys; @@ -1329,7 +1332,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) { // Test the CombineSignatures function - Amount amount = 0; + Amount amount(0); CBasicKeyStore keystore; std::vector keys; std::vector pubkeys; @@ -1342,7 +1345,7 @@ } CMutableTransaction txFrom = BuildCreditingTransaction( - GetScriptForDestination(keys[0].GetPubKey().GetID()), 0); + GetScriptForDestination(keys[0].GetPubKey().GetID()), Amount(0)); CMutableTransaction txTo = BuildSpendingTransaction(CScript(), txFrom); CScript &scriptPubKey = txFrom.vout[0].scriptPubKey; CScript &scriptSig = txTo.vin[0].scriptSig; @@ -1421,15 +1424,18 @@ // A couple of partially-signed versions: std::vector sig1; - uint256 hash1 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_ALL, 0); + uint256 hash1 = + SignatureHash(scriptPubKey, txTo, 0, SIGHASH_ALL, Amount(0)); BOOST_CHECK(keys[0].Sign(hash1, sig1)); sig1.push_back(SIGHASH_ALL); std::vector sig2; - uint256 hash2 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_NONE, 0); + uint256 hash2 = + SignatureHash(scriptPubKey, txTo, 0, SIGHASH_NONE, Amount(0)); BOOST_CHECK(keys[1].Sign(hash2, sig2)); sig2.push_back(SIGHASH_NONE); std::vector sig3; - uint256 hash3 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_SINGLE, 0); + uint256 hash3 = + SignatureHash(scriptPubKey, txTo, 0, SIGHASH_SINGLE, Amount(0)); BOOST_CHECK(keys[2].Sign(hash3, sig3)); sig3.push_back(SIGHASH_SINGLE);