From 2bf55e1d0a91fdb34e1af8e84a67e5e01fb62818 Mon Sep 17 00:00:00 2001 From: nkostoulas Date: Wed, 12 Sep 2018 16:32:09 +0100 Subject: [PATCH] Set policy asset for core unit tests --- src/test/test_bitcoin.cpp | 3 +++ src/test/txvalidationcache_tests.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 7328acca7f..79fbc5d084 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -10,6 +10,7 @@ #include "consensus/consensus.h" #include "consensus/validation.h" #include "consensus/merkle.h" +#include "policy/policy.h" #include "key.h" #include "validation.h" #include "miner.h" @@ -54,6 +55,8 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::st // MAX_MONEY SoftSetArg("-initialfreecoins", "2100000000000000"); SelectParams(chainName); + // Set policy asset for correct fee output generation + policyAsset = CAsset(uint256S(Params().GetConsensus().pegged_asset.GetHex())); noui_connect(); } diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp index ff37c463be..c7e4ec0717 100644 --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -45,10 +45,10 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) spends[i].vin[0].prevout.hash = coinbaseTxns[0].GetHash(); spends[i].vin[0].prevout.n = 0; spends[i].vout.resize(2); - spends[i].vout[0].nValue = 11*CENT; + spends[i].vout[0].nValue = MAX_MONEY-11*CENT; spends[i].vout[0].scriptPubKey = scriptPubKey; spends[i].vout[0].nAsset = Params().GetConsensus().pegged_asset; - spends[i].vout[1].nValue = MAX_MONEY-11*CENT; + spends[i].vout[1].nValue = 11*CENT; spends[i].vout[1].nAsset = Params().GetConsensus().pegged_asset; spends[i].vout[1].scriptPubKey = CScript();