mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
42 lines
1.3 KiB
C
42 lines
1.3 KiB
C
![]() |
// Copyright (c) 2022 The Bitcoin Core developers
|
||
|
// Distributed under the MIT software license, see the accompanying
|
||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||
|
|
||
|
#ifndef BITCOIN_TEST_UTIL_TXMEMPOOL_H
|
||
|
#define BITCOIN_TEST_UTIL_TXMEMPOOL_H
|
||
|
|
||
|
#include <txmempool.h>
|
||
|
|
||
|
namespace node {
|
||
|
struct NodeContext;
|
||
|
}
|
||
|
|
||
|
CTxMemPool::Options MemPoolOptionsForTest(const node::NodeContext& node);
|
||
|
|
||
|
struct TestMemPoolEntryHelper
|
||
|
{
|
||
|
// Default values
|
||
|
CAmount nFee;
|
||
|
int64_t nTime;
|
||
|
unsigned int nHeight;
|
||
|
bool spendsCoinbase;
|
||
|
unsigned int sigOpCost;
|
||
|
LockPoints lp;
|
||
|
|
||
|
TestMemPoolEntryHelper() :
|
||
|
nFee(0), nTime(0), nHeight(1),
|
||
|
spendsCoinbase(false), sigOpCost(4) { }
|
||
|
|
||
|
CTxMemPoolEntry FromTx(const CMutableTransaction& tx) const;
|
||
|
CTxMemPoolEntry FromTx(const CTransactionRef& tx) const;
|
||
|
|
||
|
// Change the default value
|
||
|
TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }
|
||
|
TestMemPoolEntryHelper &Time(int64_t _time) { nTime = _time; return *this; }
|
||
|
TestMemPoolEntryHelper &Height(unsigned int _height) { nHeight = _height; return *this; }
|
||
|
TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { spendsCoinbase = _flag; return *this; }
|
||
|
TestMemPoolEntryHelper &SigOpsCost(unsigned int _sigopsCost) { sigOpCost = _sigopsCost; return *this; }
|
||
|
};
|
||
|
|
||
|
#endif // BITCOIN_TEST_UTIL_TXMEMPOOL_H
|