Skip to content

Commit fa2d014

Browse files
author
MacroFake
committed
test: Use type-safe NodeSeconds for TestMemPoolEntryHelper
1 parent 3db23fd commit fa2d014

File tree

5 files changed

+38
-39
lines changed

5 files changed

+38
-39
lines changed

src/test/mempool_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
165165
tx5.vout.resize(1);
166166
tx5.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;
167167
tx5.vout[0].nValue = 11 * COIN;
168-
entry.nTime = 1;
168+
entry.time = NodeSeconds{1s};
169169
pool.addUnchecked(entry.Fee(10000LL).FromTx(tx5));
170170
BOOST_CHECK_EQUAL(pool.size(), 5U);
171171

@@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
225225
tx8.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;
226226
tx8.vout[0].nValue = 10 * COIN;
227227
setAncestors.insert(pool.mapTx.find(tx7.GetHash()));
228-
pool.addUnchecked(entry.Fee(0LL).Time(2).FromTx(tx8), setAncestors);
228+
pool.addUnchecked(entry.Fee(0LL).Time(NodeSeconds{2s}).FromTx(tx8), setAncestors);
229229

230230
// Now tx8 should be sorted low, but tx6/tx both high
231231
sortedOrder.insert(sortedOrder.begin(), tx8.GetHash().ToString());
@@ -239,7 +239,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
239239
tx9.vout.resize(1);
240240
tx9.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;
241241
tx9.vout[0].nValue = 1 * COIN;
242-
pool.addUnchecked(entry.Fee(0LL).Time(3).FromTx(tx9), setAncestors);
242+
pool.addUnchecked(entry.Fee(0LL).Time(NodeSeconds{3s}).FromTx(tx9), setAncestors);
243243

244244
// tx9 should be sorted low
245245
BOOST_CHECK_EQUAL(pool.size(), 9U);
@@ -262,7 +262,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
262262
tx10.vout[0].nValue = 10 * COIN;
263263

264264
setAncestorsCalculated.clear();
265-
BOOST_CHECK_EQUAL(pool.CalculateMemPoolAncestors(entry.Fee(200'000LL).Time(4).FromTx(tx10), setAncestorsCalculated, CTxMemPool::Limits::NoLimits(), dummy), true);
265+
BOOST_CHECK_EQUAL(pool.CalculateMemPoolAncestors(entry.Fee(200'000LL).Time(NodeSeconds{4s}).FromTx(tx10), setAncestorsCalculated, CTxMemPool::Limits::NoLimits(), dummy), true);
266266
BOOST_CHECK(setAncestorsCalculated == setAncestors);
267267

268268
pool.addUnchecked(entry.FromTx(tx10), setAncestors);

src/test/miner_tests.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ void MinerTestingSetup::TestPackageSelection(const CScript& scriptPubKey, const
116116
tx.vout[0].nValue = 5000000000LL - 1000;
117117
// This tx has a low fee: 1000 satoshis
118118
uint256 hashParentTx = tx.GetHash(); // save this txid for later use
119-
tx_mempool.addUnchecked(entry.Fee(1000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
119+
tx_mempool.addUnchecked(entry.Fee(1000).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
120120

121121
// This tx has a medium fee: 10000 satoshis
122122
tx.vin[0].prevout.hash = txFirst[1]->GetHash();
123123
tx.vout[0].nValue = 5000000000LL - 10000;
124124
uint256 hashMediumFeeTx = tx.GetHash();
125-
tx_mempool.addUnchecked(entry.Fee(10000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
125+
tx_mempool.addUnchecked(entry.Fee(10000).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
126126

127127
// This tx has a high fee, but depends on the first transaction
128128
tx.vin[0].prevout.hash = hashParentTx;
129129
tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 50k satoshi fee
130130
uint256 hashHighFeeTx = tx.GetHash();
131-
tx_mempool.addUnchecked(entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
131+
tx_mempool.addUnchecked(entry.Fee(50000).Time(Now<NodeSeconds>()).SpendsCoinbase(false).FromTx(tx));
132132

133133
std::unique_ptr<CBlockTemplate> pblocktemplate = AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey);
134134
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 4U);
@@ -239,7 +239,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
239239
hash = tx.GetHash();
240240
bool spendsCoinbase = i == 0; // only first tx spends coinbase
241241
// If we don't set the # of sig ops in the CTxMemPoolEntry, template creation fails
242-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
242+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
243243
tx.vin[0].prevout.hash = hash;
244244
}
245245

@@ -257,7 +257,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
257257
hash = tx.GetHash();
258258
bool spendsCoinbase = i == 0; // only first tx spends coinbase
259259
// If we do set the # of sig ops in the CTxMemPoolEntry, template creation passes
260-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).SigOpsCost(80).FromTx(tx));
260+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(spendsCoinbase).SigOpsCost(80).FromTx(tx));
261261
tx.vin[0].prevout.hash = hash;
262262
}
263263
BOOST_CHECK(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey));
@@ -281,7 +281,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
281281
tx.vout[0].nValue -= LOWFEE;
282282
hash = tx.GetHash();
283283
bool spendsCoinbase = i == 0; // only first tx spends coinbase
284-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
284+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
285285
tx.vin[0].prevout.hash = hash;
286286
}
287287
BOOST_CHECK(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey));
@@ -293,7 +293,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
293293

294294
// orphan in tx_mempool, template creation fails
295295
hash = tx.GetHash();
296-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).FromTx(tx));
296+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).FromTx(tx));
297297
BOOST_CHECK_EXCEPTION(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-txns-inputs-missingorspent"));
298298
}
299299

@@ -306,15 +306,15 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
306306
tx.vin[0].prevout.hash = txFirst[1]->GetHash();
307307
tx.vout[0].nValue = BLOCKSUBSIDY - HIGHFEE;
308308
hash = tx.GetHash();
309-
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
309+
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
310310
tx.vin[0].prevout.hash = hash;
311311
tx.vin.resize(2);
312312
tx.vin[1].scriptSig = CScript() << OP_1;
313313
tx.vin[1].prevout.hash = txFirst[0]->GetHash();
314314
tx.vin[1].prevout.n = 0;
315315
tx.vout[0].nValue = tx.vout[0].nValue + BLOCKSUBSIDY - HIGHERFEE; // First txn output + fresh coinbase - new txn fee
316316
hash = tx.GetHash();
317-
tx_mempool.addUnchecked(entry.Fee(HIGHERFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
317+
tx_mempool.addUnchecked(entry.Fee(HIGHERFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
318318
BOOST_CHECK(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey));
319319
}
320320

@@ -329,7 +329,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
329329
tx.vout[0].nValue = 0;
330330
hash = tx.GetHash();
331331
// give it a fee so it'll get mined
332-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
332+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(false).FromTx(tx));
333333
// Should throw bad-cb-multiple
334334
BOOST_CHECK_EXCEPTION(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-cb-multiple"));
335335
}
@@ -344,10 +344,10 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
344344
tx.vout[0].nValue = BLOCKSUBSIDY - HIGHFEE;
345345
tx.vout[0].scriptPubKey = CScript() << OP_1;
346346
hash = tx.GetHash();
347-
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
347+
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
348348
tx.vout[0].scriptPubKey = CScript() << OP_2;
349349
hash = tx.GetHash();
350-
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
350+
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
351351
BOOST_CHECK_EXCEPTION(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-txns-inputs-missingorspent"));
352352
}
353353

@@ -390,12 +390,12 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
390390
CScript script = CScript() << OP_0;
391391
tx.vout[0].scriptPubKey = GetScriptForDestination(ScriptHash(script));
392392
hash = tx.GetHash();
393-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
393+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
394394
tx.vin[0].prevout.hash = hash;
395395
tx.vin[0].scriptSig = CScript() << std::vector<unsigned char>(script.begin(), script.end());
396396
tx.vout[0].nValue -= LOWFEE;
397397
hash = tx.GetHash();
398-
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
398+
tx_mempool.addUnchecked(entry.Fee(LOWFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(false).FromTx(tx));
399399
// Should throw block-validation-failed
400400
BOOST_CHECK_EXCEPTION(AssemblerForTest(tx_mempool).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("block-validation-failed"));
401401

@@ -432,7 +432,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
432432
tx.vout[0].scriptPubKey = CScript() << OP_1;
433433
tx.nLockTime = 0;
434434
hash = tx.GetHash();
435-
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
435+
tx_mempool.addUnchecked(entry.Fee(HIGHFEE).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
436436
BOOST_CHECK(CheckFinalTxAtTip(*Assert(m_node.chainman->ActiveChain().Tip()), CTransaction{tx})); // Locktime passes
437437
BOOST_CHECK(!TestSequenceLocks(CTransaction{tx}, tx_mempool)); // Sequence locks fail
438438

@@ -446,7 +446,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
446446
tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | (((m_node.chainman->ActiveChain().Tip()->GetMedianTimePast()+1-m_node.chainman->ActiveChain()[1]->GetMedianTimePast()) >> CTxIn::SEQUENCE_LOCKTIME_GRANULARITY) + 1); // txFirst[1] is the 3rd block
447447
prevheights[0] = baseheight + 2;
448448
hash = tx.GetHash();
449-
tx_mempool.addUnchecked(entry.Time(GetTime()).FromTx(tx));
449+
tx_mempool.addUnchecked(entry.Time(Now<NodeSeconds>()).FromTx(tx));
450450
BOOST_CHECK(CheckFinalTxAtTip(*Assert(m_node.chainman->ActiveChain().Tip()), CTransaction{tx})); // Locktime passes
451451
BOOST_CHECK(!TestSequenceLocks(CTransaction{tx}, tx_mempool)); // Sequence locks fail
452452

@@ -469,7 +469,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
469469
prevheights[0] = baseheight + 3;
470470
tx.nLockTime = m_node.chainman->ActiveChain().Tip()->nHeight + 1;
471471
hash = tx.GetHash();
472-
tx_mempool.addUnchecked(entry.Time(GetTime()).FromTx(tx));
472+
tx_mempool.addUnchecked(entry.Time(Now<NodeSeconds>()).FromTx(tx));
473473
BOOST_CHECK(!CheckFinalTxAtTip(*Assert(m_node.chainman->ActiveChain().Tip()), CTransaction{tx})); // Locktime fails
474474
BOOST_CHECK(TestSequenceLocks(CTransaction{tx}, tx_mempool)); // Sequence locks pass
475475
BOOST_CHECK(IsFinalTx(CTransaction(tx), m_node.chainman->ActiveChain().Tip()->nHeight + 2, m_node.chainman->ActiveChain().Tip()->GetMedianTimePast())); // Locktime passes on 2nd block
@@ -480,7 +480,7 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
480480
prevheights.resize(1);
481481
prevheights[0] = baseheight + 4;
482482
hash = tx.GetHash();
483-
tx_mempool.addUnchecked(entry.Time(GetTime()).FromTx(tx));
483+
tx_mempool.addUnchecked(entry.Time(Now<NodeSeconds>()).FromTx(tx));
484484
BOOST_CHECK(!CheckFinalTxAtTip(*Assert(m_node.chainman->ActiveChain().Tip()), CTransaction{tx})); // Locktime fails
485485
BOOST_CHECK(TestSequenceLocks(CTransaction{tx}, tx_mempool)); // Sequence locks pass
486486
BOOST_CHECK(IsFinalTx(CTransaction(tx), m_node.chainman->ActiveChain().Tip()->nHeight + 2, m_node.chainman->ActiveChain().Tip()->GetMedianTimePast() + 1)); // Locktime passes 1 second later
@@ -535,28 +535,28 @@ void MinerTestingSetup::TestPrioritisedMining(const CScript& scriptPubKey, const
535535
tx.vout.resize(1);
536536
tx.vout[0].nValue = 5000000000LL; // 0 fee
537537
uint256 hashFreePrioritisedTx = tx.GetHash();
538-
tx_mempool.addUnchecked(entry.Fee(0).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
538+
tx_mempool.addUnchecked(entry.Fee(0).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
539539
tx_mempool.PrioritiseTransaction(hashFreePrioritisedTx, 5 * COIN);
540540

541541
tx.vin[0].prevout.hash = txFirst[1]->GetHash();
542542
tx.vin[0].prevout.n = 0;
543543
tx.vout[0].nValue = 5000000000LL - 1000;
544544
// This tx has a low fee: 1000 satoshis
545545
uint256 hashParentTx = tx.GetHash(); // save this txid for later use
546-
tx_mempool.addUnchecked(entry.Fee(1000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
546+
tx_mempool.addUnchecked(entry.Fee(1000).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
547547

548548
// This tx has a medium fee: 10000 satoshis
549549
tx.vin[0].prevout.hash = txFirst[2]->GetHash();
550550
tx.vout[0].nValue = 5000000000LL - 10000;
551551
uint256 hashMediumFeeTx = tx.GetHash();
552-
tx_mempool.addUnchecked(entry.Fee(10000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
552+
tx_mempool.addUnchecked(entry.Fee(10000).Time(Now<NodeSeconds>()).SpendsCoinbase(true).FromTx(tx));
553553
tx_mempool.PrioritiseTransaction(hashMediumFeeTx, -5 * COIN);
554554

555555
// This tx also has a low fee, but is prioritised
556556
tx.vin[0].prevout.hash = hashParentTx;
557557
tx.vout[0].nValue = 5000000000LL - 1000 - 1000; // 1000 satoshi fee
558558
uint256 hashPrioritsedChild = tx.GetHash();
559-
tx_mempool.addUnchecked(entry.Fee(1000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
559+
tx_mempool.addUnchecked(entry.Fee(1000).Time(Now<NodeSeconds>()).SpendsCoinbase(false).FromTx(tx));
560560
tx_mempool.PrioritiseTransaction(hashPrioritsedChild, 2 * COIN);
561561

562562
// Test that transaction selection properly updates ancestor fee calculations as prioritised

src/test/policyestimator_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
5959
for (int k = 0; k < 4; k++) { // add 4 fee txs
6060
tx.vin[0].prevout.n = 10000*blocknum+100*j+k; // make transaction unique
6161
uint256 hash = tx.GetHash();
62-
mpool.addUnchecked(entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx));
62+
mpool.addUnchecked(entry.Fee(feeV[j]).Time(Now<NodeSeconds>()).Height(blocknum).FromTx(tx));
6363
txHashes[j].push_back(hash);
6464
}
6565
}
@@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
130130
for (int k = 0; k < 4; k++) { // add 4 fee txs
131131
tx.vin[0].prevout.n = 10000*blocknum+100*j+k;
132132
uint256 hash = tx.GetHash();
133-
mpool.addUnchecked(entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx));
133+
mpool.addUnchecked(entry.Fee(feeV[j]).Time(Now<NodeSeconds>()).Height(blocknum).FromTx(tx));
134134
txHashes[j].push_back(hash);
135135
}
136136
}
@@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
165165
for (int k = 0; k < 4; k++) { // add 4 fee txs
166166
tx.vin[0].prevout.n = 10000*blocknum+100*j+k;
167167
uint256 hash = tx.GetHash();
168-
mpool.addUnchecked(entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx));
168+
mpool.addUnchecked(entry.Fee(feeV[j]).Time(Now<NodeSeconds>()).Height(blocknum).FromTx(tx));
169169
CTransactionRef ptx = mpool.get(hash);
170170
if (ptx)
171171
block.push_back(ptx);

src/test/util/txmempool.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction& tx) co
3434

3535
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransactionRef& tx) const
3636
{
37-
return CTxMemPoolEntry(tx, nFee, nTime, nHeight,
38-
spendsCoinbase, sigOpCost, lp);
37+
return CTxMemPoolEntry{tx, nFee, TicksSinceEpoch<std::chrono::seconds>(time), nHeight, spendsCoinbase, sigOpCost, lp};
3938
}

src/test/util/txmempool.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
#define BITCOIN_TEST_UTIL_TXMEMPOOL_H
77

88
#include <txmempool.h>
9+
#include <util/time.h>
910

1011
namespace node {
1112
struct NodeContext;
1213
}
1314

1415
CTxMemPool::Options MemPoolOptionsForTest(const node::NodeContext& node);
1516

16-
struct TestMemPoolEntryHelper
17-
{
17+
struct TestMemPoolEntryHelper {
1818
// Default values
1919
CAmount nFee{0};
20-
int64_t nTime{0};
20+
NodeSeconds time{};
2121
unsigned int nHeight{1};
2222
bool spendsCoinbase{false};
2323
unsigned int sigOpCost{4};
@@ -27,11 +27,11 @@ struct TestMemPoolEntryHelper
2727
CTxMemPoolEntry FromTx(const CTransactionRef& tx) const;
2828

2929
// Change the default value
30-
TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }
31-
TestMemPoolEntryHelper &Time(int64_t _time) { nTime = _time; return *this; }
32-
TestMemPoolEntryHelper &Height(unsigned int _height) { nHeight = _height; return *this; }
33-
TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { spendsCoinbase = _flag; return *this; }
34-
TestMemPoolEntryHelper &SigOpsCost(unsigned int _sigopsCost) { sigOpCost = _sigopsCost; return *this; }
30+
TestMemPoolEntryHelper& Fee(CAmount _fee) { nFee = _fee; return *this; }
31+
TestMemPoolEntryHelper& Time(NodeSeconds tp) { time = tp; return *this; }
32+
TestMemPoolEntryHelper& Height(unsigned int _height) { nHeight = _height; return *this; }
33+
TestMemPoolEntryHelper& SpendsCoinbase(bool _flag) { spendsCoinbase = _flag; return *this; }
34+
TestMemPoolEntryHelper& SigOpsCost(unsigned int _sigopsCost) { sigOpCost = _sigopsCost; return *this; }
3535
};
3636

3737
#endif // BITCOIN_TEST_UTIL_TXMEMPOOL_H

0 commit comments

Comments
 (0)