Skip to content

Commit cd56626

Browse files
committed
[BROKEN] Adapt existing unit tests to CA
1 parent f4553d4 commit cd56626

File tree

9 files changed

+77
-58
lines changed

9 files changed

+77
-58
lines changed

src/test/blockfilter_tests.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <test/data/blockfilters.json.h>
66
#include <test/test_bitcoin.h>
77

8+
#include <asset.h>
89
#include <blockfilter.h>
910
#include <core_io.h>
1011
#include <serialize.h>
@@ -61,23 +62,23 @@ BOOST_AUTO_TEST_CASE(blockfilter_basic_test)
6162
excluded_scripts[1] << std::vector<unsigned char>(5, 33) << OP_CHECKSIG;
6263

6364
CMutableTransaction tx_1;
64-
tx_1.vout.emplace_back(100, included_scripts[0]);
65-
tx_1.vout.emplace_back(200, included_scripts[1]);
65+
tx_1.vout.emplace_back(CTxOut(CAsset(), 100, included_scripts[0]));
66+
tx_1.vout.emplace_back(CTxOut(CAsset(), 200, included_scripts[1]));
6667

6768
CMutableTransaction tx_2;
68-
tx_2.vout.emplace_back(300, included_scripts[2]);
69-
tx_2.vout.emplace_back(0, excluded_scripts[0]);
70-
tx_2.vout.emplace_back(400, excluded_scripts[2]); // Script is empty
69+
tx_2.vout.emplace_back(CTxOut(CAsset(), 300, included_scripts[2]));
70+
tx_2.vout.emplace_back(CTxOut(CAsset(), 0, excluded_scripts[0]));
71+
tx_2.vout.emplace_back(CTxOut(CAsset(), 400, excluded_scripts[2])); // Script is empty
7172

7273
CBlock block;
7374
block.vtx.push_back(MakeTransactionRef(tx_1));
7475
block.vtx.push_back(MakeTransactionRef(tx_2));
7576

7677
CBlockUndo block_undo;
7778
block_undo.vtxundo.emplace_back();
78-
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(500, included_scripts[3]), 1000, true);
79-
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(600, included_scripts[4]), 10000, false);
80-
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(700, excluded_scripts[2]), 100000, false);
79+
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(CAsset(), 500, included_scripts[3]), 1000, true);
80+
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(CAsset(), 600, included_scripts[4]), 10000, false);
81+
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(CAsset(), 700, excluded_scripts[2]), 100000, false);
8182

8283
BlockFilter block_filter(BlockFilterType::BASIC, block, block_undo);
8384
const GCSFilter& filter = block_filter.GetFilter();
@@ -125,7 +126,7 @@ BOOST_AUTO_TEST_CASE(blockfilters_json_test)
125126
const UniValue& prev_scripts = test[pos++].get_array();
126127
for (unsigned int ii = 0; ii < prev_scripts.size(); ii++) {
127128
std::vector<unsigned char> raw_script = ParseHex(prev_scripts[ii].get_str());
128-
CTxOut txout(0, CScript(raw_script.begin(), raw_script.end()));
129+
CTxOut txout(CAsset(), 0, CScript(raw_script.begin(), raw_script.end()));
129130
tx_undo.vprevout.emplace_back(txout, 0, false);
130131
}
131132

src/test/checkqueue_tests.cpp

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void Correct_Queue_range(std::vector<size_t> range)
154154
tg.create_thread([&]{small_queue->Thread();});
155155
}
156156
// Make vChecks here to save on malloc (this test can be slow...)
157-
std::vector<FakeCheckCheckCompletion> vChecks;
157+
std::vector<FakeCheckCheckCompletion*> vChecks;
158158
for (const size_t i : range) {
159159
size_t total = i;
160160
FakeCheckCheckCompletion::n_calls = 0;
@@ -226,10 +226,10 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Catches_Failure)
226226
while (remaining) {
227227
size_t r = InsecureRandRange(10);
228228

229-
std::vector<FailingCheck> vChecks;
230-
vChecks.reserve(r);
231-
for (size_t k = 0; k < r && remaining; k++, remaining--)
232-
vChecks.emplace_back(remaining == 1);
229+
std::vector<FailingCheck*> vChecks;
230+
for (size_t k = 0; k < r && remaining; k++, remaining--) {
231+
vChecks.push_back(new FailingCheck(remaining == 1));
232+
}
233233
control.Add(vChecks);
234234
}
235235
bool success = control.Wait();
@@ -256,9 +256,11 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Recovers_From_Failure)
256256
for (const bool end_fails : {true, false}) {
257257
CCheckQueueControl<FailingCheck> control(fail_queue.get());
258258
{
259-
std::vector<FailingCheck> vChecks;
260-
vChecks.resize(100, false);
261-
vChecks[99] = end_fails;
259+
std::vector<FailingCheck*> vChecks;
260+
for (size_t i = 0; i < 100; i++) {
261+
vChecks.push_back(new FailingCheck(false));
262+
}
263+
vChecks[99] = new FailingCheck(end_fails);
262264
control.Add(vChecks);
263265
}
264266
bool r =control.Wait();
@@ -287,9 +289,10 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_UniqueCheck)
287289
CCheckQueueControl<UniqueCheck> control(queue.get());
288290
while (total) {
289291
size_t r = InsecureRandRange(10);
290-
std::vector<UniqueCheck> vChecks;
291-
for (size_t k = 0; k < r && total; k++)
292-
vChecks.emplace_back(--total);
292+
std::vector<UniqueCheck*> vChecks;
293+
for (size_t k = 0; k < r && total; k++) {
294+
vChecks.emplace_back(new UniqueCheck(--total));
295+
}
293296
control.Add(vChecks);
294297
}
295298
}
@@ -321,12 +324,12 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Memory)
321324
CCheckQueueControl<MemoryCheck> control(queue.get());
322325
while (total) {
323326
size_t r = InsecureRandRange(10);
324-
std::vector<MemoryCheck> vChecks;
327+
std::vector<MemoryCheck*> vChecks;
325328
for (size_t k = 0; k < r && total; k++) {
326329
total--;
327330
// Each iteration leaves data at the front, back, and middle
328331
// to catch any sort of deallocation failure
329-
vChecks.emplace_back(total == 0 || total == i || total == i/2);
332+
vChecks.emplace_back(new MemoryCheck(total == 0 || total == i || total == i/2));
330333
}
331334
control.Add(vChecks);
332335
}
@@ -349,11 +352,12 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
349352
}
350353
std::thread t0([&]() {
351354
CCheckQueueControl<FrozenCleanupCheck> control(queue.get());
352-
std::vector<FrozenCleanupCheck> vChecks(1);
355+
std::vector<FrozenCleanupCheck*> vChecks;
353356
// Freezing can't be the default initialized behavior given how the queue
354357
// swaps in default initialized Checks (otherwise freezing destructor
355358
// would get called twice).
356-
vChecks[0].should_freeze = true;
359+
vChecks.push_back(new FrozenCleanupCheck());
360+
vChecks[0]->should_freeze = true;
357361
control.Add(vChecks);
358362
control.Wait(); // Hangs here
359363
});

src/test/coins_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ BOOST_AUTO_TEST_CASE(ccoins_serialization)
499499
ss3 >> cc3;
500500
BOOST_CHECK_EQUAL(cc3.fCoinBase, false);
501501
BOOST_CHECK_EQUAL(cc3.nHeight, 0U);
502-
BOOST_CHECK_EQUAL(cc3.out.nValue, 0);
502+
BOOST_CHECK_EQUAL(cc3.out.nValue.GetAmount(), 0);
503503
BOOST_CHECK_EQUAL(cc3.out.scriptPubKey.size(), 0U);
504504

505505
// scriptPubKey that ends beyond the end of the stream
@@ -577,7 +577,7 @@ void GetCoinsMapEntry(const CCoinsMap& map, CAmount& value, char& flags)
577577
if (it->second.coin.IsSpent()) {
578578
value = PRUNED;
579579
} else {
580-
value = it->second.coin.out.nValue;
580+
value = it->second.coin.out.nValue.GetAmount();
581581
}
582582
flags = it->second.flags;
583583
assert(flags != NO_ENTRY);

src/test/miner_tests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static void TestPackageSelection(const CChainParams& chainparams, const CScript&
160160
// of the transactions is below the min relay fee
161161
// Remove the low fee transaction and replace with a higher fee transaction
162162
mempool.removeRecursive(tx);
163-
tx.vout[0].nValue -= 2; // Now we should be just over the min relay fee
163+
tx.vout[0].nValue = tx.vout[0].nValue.GetAmount() - 2; // Now we should be just over the min relay fee
164164
hashLowFeeTx = tx.GetHash();
165165
mempool.addUnchecked(entry.Fee(feeToUse+2).FromTx(tx));
166166
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
@@ -273,7 +273,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
273273
tx.vout[0].nValue = BLOCKSUBSIDY;
274274
for (unsigned int i = 0; i < 1001; ++i)
275275
{
276-
tx.vout[0].nValue -= LOWFEE;
276+
tx.vout[0].nValue = tx.vout[0].nValue.GetAmount() - LOWFEE;
277277
hash = tx.GetHash();
278278
bool spendsCoinbase = i == 0; // only first tx spends coinbase
279279
// If we don't set the # of sig ops in the CTxMemPoolEntry, template creation fails
@@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
288288
tx.vout[0].nValue = BLOCKSUBSIDY;
289289
for (unsigned int i = 0; i < 1001; ++i)
290290
{
291-
tx.vout[0].nValue -= LOWFEE;
291+
tx.vout[0].nValue = tx.vout[0].nValue.GetAmount() - LOWFEE;
292292
hash = tx.GetHash();
293293
bool spendsCoinbase = i == 0; // only first tx spends coinbase
294294
// If we do set the # of sig ops in the CTxMemPoolEntry, template creation passes
@@ -309,7 +309,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
309309
tx.vout[0].nValue = BLOCKSUBSIDY;
310310
for (unsigned int i = 0; i < 128; ++i)
311311
{
312-
tx.vout[0].nValue -= LOWFEE;
312+
tx.vout[0].nValue = tx.vout[0].nValue.GetAmount() - LOWFEE;
313313
hash = tx.GetHash();
314314
bool spendsCoinbase = i == 0; // only first tx spends coinbase
315315
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
@@ -335,7 +335,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
335335
tx.vin[1].scriptSig = CScript() << OP_1;
336336
tx.vin[1].prevout.hash = txFirst[0]->GetHash();
337337
tx.vin[1].prevout.n = 0;
338-
tx.vout[0].nValue = tx.vout[0].nValue+BLOCKSUBSIDY-HIGHERFEE; //First txn output + fresh coinbase - new txn fee
338+
tx.vout[0].nValue = tx.vout[0].nValue.GetAmount() + BLOCKSUBSIDY - HIGHERFEE; //First txn output + fresh coinbase - new txn fee
339339
hash = tx.GetHash();
340340
mempool.addUnchecked(entry.Fee(HIGHERFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
341341
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
@@ -404,7 +404,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
404404
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
405405
tx.vin[0].prevout.hash = hash;
406406
tx.vin[0].scriptSig = CScript() << std::vector<unsigned char>(script.begin(), script.end());
407-
tx.vout[0].nValue -= LOWFEE;
407+
tx.vout[0].nValue = tx.vout[0].nValue.GetAmount() - LOWFEE;
408408
hash = tx.GetHash();
409409
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
410410
// Should throw block-validation-failed

src/test/pegin_witness_tests.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@
2525

2626
std::vector<std::vector<unsigned char> > witness_stack = {
2727
ParseHex("00ca9a3b00000000"),
28-
ParseHex("e48a1a02a8f799892fda58347c2d794144311d4307dbfd10f77ffe28088c60be"),
28+
ParseHex("ef4699c160d014d5ff79636d8a4cb990b9df4ebab649f144d19f5c495c585e47"),
2929
ParseHex("06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f"),
3030
ParseHex("00141eef6361cd1507a303834285d1521d6baf1b19ae"),
3131
ParseHex("0200000001b399292c8100b8a1b66eb23896f799c1712390d560af0f70e81acd2d17a3b06e0000000049483045022100c3c749623486ea57ea93dfaf78d85590d78c7590a25768fe80f0ea4d6047419002202a0a00a90392b86c53c0fdda908c4591ba28040c16c25734c23b7df3c8b70acd01feffffff0228196bee000000001976a914470dd41542ee1a1bd75f1a838878648c8d65622488ac00ca9a3b0000000017a914cb60b1d7f76ba12b45a116c482c165a74c5d7e388765000000"),
3232
ParseHex("000000205e3913a320cd2e3a2efa141e47419f54cb9e82320cf8dbc812fc19b9a1b2413a57f5e9fb4fa22de191454a241387f5d10cc794ee0fbf72ae2841baf3129a4eab8133025affff7f20000000000200000002f9d0be670007d38fceece999cb6144658a99c307ccc37f6d8f69129ed0f4545ff321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce0105")
3333
};
3434

35-
//std::vector<unsigned char> pegin_transaction = ParseHex("020000000101f321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce0100004000ffffffff0201e48a1a02a8f799892fda58347c2d794144311d4307dbfd10f77ffe28088c60be01000000003b9ab2e0001976a914809326f7628dc976fbe63806479a1b8dfcc8c4b988ac01e48a1a02a8f799892fda58347c2d794144311d4307dbfd10f77ffe28088c60be010000000000001720000000000000000002483045022100ae17064745d80650a6a5cbcbe15c8c45ba498d1c6f45a7c0f5f32d871b463fc60220799f2836471702c21f7cfe124651727b530ad41f7af4dc213c65f5030a2f6fc4012103a9d3c6c7c161a565a76113632fe13330cf2c0207ba79a76d1154cdc3cb94d940060800ca9a3b0000000020e48a1a02a8f799892fda58347c2d794144311d4307dbfd10f77ffe28088c60be2006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f1600141eef6361cd1507a303834285d1521d6baf1b19aebe0200000001b399292c8100b8a1b66eb23896f799c1712390d560af0f70e81acd2d17a3b06e0000000049483045022100c3c749623486ea57ea93dfaf78d85590d78c7590a25768fe80f0ea4d6047419002202a0a00a90392b86c53c0fdda908c4591ba28040c16c25734c23b7df3c8b70acd01feffffff0228196bee000000001976a914470dd41542ee1a1bd75f1a838878648c8d65622488ac00ca9a3b0000000017a914cb60b1d7f76ba12b45a116c482c165a74c5d7e38876500000097000000205e3913a320cd2e3a2efa141e47419f54cb9e82320cf8dbc812fc19b9a1b2413a57f5e9fb4fa22de191454a241387f5d10cc794ee0fbf72ae2841baf3129a4eab8133025affff7f20000000000200000002f9d0be670007d38fceece999cb6144658a99c307ccc37f6d8f69129ed0f4545ff321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce010500000000");
36-
std::vector<unsigned char> pegin_transaction = ParseHex("020000000101f321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce0100004000ffffffff02e0b29a3b000000001976a914809326f7628dc976fbe63806479a1b8dfcc8c4b988ac2017000000000000000000000002483045022100ae17064745d80650a6a5cbcbe15c8c45ba498d1c6f45a7c0f5f32d871b463fc60220799f2836471702c21f7cfe124651727b530ad41f7af4dc213c65f5030a2f6fc4012103a9d3c6c7c161a565a76113632fe13330cf2c0207ba79a76d1154cdc3cb94d940060800ca9a3b0000000020e48a1a02a8f799892fda58347c2d794144311d4307dbfd10f77ffe28088c60be2006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f1600141eef6361cd1507a303834285d1521d6baf1b19aebe0200000001b399292c8100b8a1b66eb23896f799c1712390d560af0f70e81acd2d17a3b06e0000000049483045022100c3c749623486ea57ea93dfaf78d85590d78c7590a25768fe80f0ea4d6047419002202a0a00a90392b86c53c0fdda908c4591ba28040c16c25734c23b7df3c8b70acd01feffffff0228196bee000000001976a914470dd41542ee1a1bd75f1a838878648c8d65622488ac00ca9a3b0000000017a914cb60b1d7f76ba12b45a116c482c165a74c5d7e38876500000097000000205e3913a320cd2e3a2efa141e47419f54cb9e82320cf8dbc812fc19b9a1b2413a57f5e9fb4fa22de191454a241387f5d10cc794ee0fbf72ae2841baf3129a4eab8133025affff7f20000000000200000002f9d0be670007d38fceece999cb6144658a99c307ccc37f6d8f69129ed0f4545ff321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce0105");
37-
35+
std::vector<unsigned char> pegin_transaction = ParseHex("020000000101f321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce0100004000ffffffff0201ef4699c160d014d5ff79636d8a4cb990b9df4ebab649f144d19f5c495c585e4701000000003b9ab2e0001976a914809326f7628dc976fbe63806479a1b8dfcc8c4b988ac01ef4699c160d014d5ff79636d8a4cb990b9df4ebab649f144d19f5c495c585e47010000000000001720000000000000000002483045022100ae17064745d80650a6a5cbcbe15c8c45ba498d1c6f45a7c0f5f32d871b463fc60220799f2836471702c21f7cfe124651727b530ad41f7af4dc213c65f5030a2f6fc4012103a9d3c6c7c161a565a76113632fe13330cf2c0207ba79a76d1154cdc3cb94d940060800ca9a3b0000000020ef4699c160d014d5ff79636d8a4cb990b9df4ebab649f144d19f5c495c585e472006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f1600141eef6361cd1507a303834285d1521d6baf1b19aebe0200000001b399292c8100b8a1b66eb23896f799c1712390d560af0f70e81acd2d17a3b06e0000000049483045022100c3c749623486ea57ea93dfaf78d85590d78c7590a25768fe80f0ea4d6047419002202a0a00a90392b86c53c0fdda908c4591ba28040c16c25734c23b7df3c8b70acd01feffffff0228196bee000000001976a914470dd41542ee1a1bd75f1a838878648c8d65622488ac00ca9a3b0000000017a914cb60b1d7f76ba12b45a116c482c165a74c5d7e38876500000097000000205e3913a320cd2e3a2efa141e47419f54cb9e82320cf8dbc812fc19b9a1b2413a57f5e9fb4fa22de191454a241387f5d10cc794ee0fbf72ae2841baf3129a4eab8133025affff7f20000000000200000002f9d0be670007d38fceece999cb6144658a99c307ccc37f6d8f69129ed0f4545ff321df9790633bc33c67239c4174df8142ee616ee6a2e2788fe4820fe70e9bce010500000000");
3836

3937
COutPoint prevout(uint256S("ce9b0ee70f82e48f78e2a2e66e61ee4281df74419c23673cc33b639097df21f3"), 1);
4038

@@ -59,10 +57,6 @@ BOOST_AUTO_TEST_CASE(witness_valid)
5957
// Missing byte on each field to make claim ill-formatted
6058
// This will break deserialization and other data-matching checks
6159
for (unsigned int i = 0; i < witness.stack.size(); i++) {
62-
//TODO(rebase) CA remove this exception
63-
if (i == 1) {
64-
continue;
65-
}
6660
witness.stack[i].pop_back();
6761
BOOST_CHECK(!IsValidPeginWitness(witness, prevout, err, false));
6862
witness.stack = witness_stack;
@@ -95,32 +89,37 @@ BOOST_AUTO_TEST_CASE(witness_valid)
9589
// Check validation of peg-in transaction's inputs and balance
9690
CDataStream ssTx(pegin_transaction, SER_NETWORK, PROTOCOL_VERSION);
9791
CTransactionRef txRef;
98-
ssTx >> txRef;
92+
try {
93+
ssTx >> txRef;
94+
} catch (...) {
95+
BOOST_CHECK(false);
96+
return;
97+
}
9998
CTransaction tx(*txRef);
10099

101100
// Only one(valid) input witness should exist, and should match
102101
BOOST_CHECK(tx.witness.vtxinwit.size() == 1);
103102
BOOST_CHECK(tx.witness.vtxinwit[0].m_pegin_witness.stack == witness_stack);
104103
BOOST_CHECK(tx.vin[0].m_is_pegin);
105104
// Check that serialization doesn't cause issuance to become non-null
106-
//TODO(rebase) CA
107-
//BOOST_CHECK(tx.vin[0].assetIssuance.IsNull());
105+
BOOST_CHECK(tx.vin[0].assetIssuance.IsNull());
108106
BOOST_CHECK(IsValidPeginWitness(tx.witness.vtxinwit[0].m_pegin_witness, prevout, err, false));
109107

108+
CAmountMap fee_map;
109+
110110
std::set<std::pair<uint256, COutPoint> > setPeginsSpent;
111111
CValidationState state;
112112
CCoinsView coinsDummy;
113113
CCoinsViewCache coins(&coinsDummy);
114-
CAmount txfee;
115-
BOOST_CHECK(Consensus::CheckTxInputs(tx, state, coins, 0, txfee, setPeginsSpent));
114+
BOOST_CHECK(Consensus::CheckTxInputs(tx, state, coins, 0, fee_map, setPeginsSpent, NULL, false, true));
116115
BOOST_CHECK(setPeginsSpent.size() == 1);
117116
setPeginsSpent.clear();
118117

119118
// Strip pegin_witness
120119
CMutableTransaction mtxn(tx);
121120
mtxn.witness.vtxinwit[0].m_pegin_witness.SetNull();
122121
CTransaction tx2(mtxn);
123-
BOOST_CHECK(!Consensus::CheckTxInputs(tx2, state, coins, 0, txfee, setPeginsSpent));
122+
BOOST_CHECK(!Consensus::CheckTxInputs(tx2, state, coins, 0, fee_map, setPeginsSpent, NULL, false, true));
124123
BOOST_CHECK(setPeginsSpent.empty());
125124

126125
// Invalidate peg-in (and spending) authorization by pegin marker.
@@ -129,7 +128,7 @@ BOOST_AUTO_TEST_CASE(witness_valid)
129128
CMutableTransaction mtxn2(tx);
130129
mtxn2.vin[0].m_is_pegin = false;
131130
CTransaction tx3(mtxn2);
132-
BOOST_CHECK(!Consensus::CheckTxInputs(tx3, state, coins, 0, txfee, setPeginsSpent));
131+
BOOST_CHECK(!Consensus::CheckTxInputs(tx3, state, coins, 0, fee_map, setPeginsSpent, NULL, false, true));
133132
BOOST_CHECK(setPeginsSpent.empty());
134133

135134

0 commit comments

Comments
 (0)