Set policy asset for core unit tests

This commit is contained in:
nkostoulas 2018-09-12 16:32:09 +01:00
parent 9644d663f6
commit 2bf55e1d0a
No known key found for this signature in database
GPG key ID: 895CA38EFC54460F
2 changed files with 5 additions and 2 deletions

View file

@ -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();
}

View file

@ -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();