Skip to content

Commit d644293

Browse files
committed
Merge #409: Set policyAsset for core unit tests
2bf55e1 Set policy asset for core unit tests (nkostoulas)
2 parents 9644d66 + 2bf55e1 commit d644293

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/test/test_bitcoin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "consensus/consensus.h"
1111
#include "consensus/validation.h"
1212
#include "consensus/merkle.h"
13+
#include "policy/policy.h"
1314
#include "key.h"
1415
#include "validation.h"
1516
#include "miner.h"
@@ -54,6 +55,8 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::st
5455
// MAX_MONEY
5556
SoftSetArg("-initialfreecoins", "2100000000000000");
5657
SelectParams(chainName);
58+
// Set policy asset for correct fee output generation
59+
policyAsset = CAsset(uint256S(Params().GetConsensus().pegged_asset.GetHex()));
5760
noui_connect();
5861
}
5962

src/test/txvalidationcache_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
4545
spends[i].vin[0].prevout.hash = coinbaseTxns[0].GetHash();
4646
spends[i].vin[0].prevout.n = 0;
4747
spends[i].vout.resize(2);
48-
spends[i].vout[0].nValue = 11*CENT;
48+
spends[i].vout[0].nValue = MAX_MONEY-11*CENT;
4949
spends[i].vout[0].scriptPubKey = scriptPubKey;
5050
spends[i].vout[0].nAsset = Params().GetConsensus().pegged_asset;
51-
spends[i].vout[1].nValue = MAX_MONEY-11*CENT;
51+
spends[i].vout[1].nValue = 11*CENT;
5252
spends[i].vout[1].nAsset = Params().GetConsensus().pegged_asset;
5353
spends[i].vout[1].scriptPubKey = CScript();
5454

0 commit comments

Comments
 (0)