Implement helper class for CTxMemPoolEntry constructor
This is only for unit tests.
This commit is contained in:
@@ -36,4 +36,29 @@ struct TestingSetup: public JoinSplitTestingSetup {
|
||||
~TestingSetup();
|
||||
};
|
||||
|
||||
class CTxMemPoolEntry;
|
||||
class CTxMemPool;
|
||||
|
||||
struct TestMemPoolEntryHelper
|
||||
{
|
||||
// Default values
|
||||
CAmount nFee;
|
||||
int64_t nTime;
|
||||
double dPriority;
|
||||
unsigned int nHeight;
|
||||
bool hadNoDependencies;
|
||||
|
||||
TestMemPoolEntryHelper() :
|
||||
nFee(0), nTime(0), dPriority(0.0), nHeight(1),
|
||||
hadNoDependencies(false) { }
|
||||
|
||||
CTxMemPoolEntry FromTx(CMutableTransaction &tx, CTxMemPool *pool = NULL);
|
||||
|
||||
// Change the default value
|
||||
TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }
|
||||
TestMemPoolEntryHelper &Time(int64_t _time) { nTime = _time; return *this; }
|
||||
TestMemPoolEntryHelper &Priority(double _priority) { dPriority = _priority; return *this; }
|
||||
TestMemPoolEntryHelper &Height(unsigned int _height) { nHeight = _height; return *this; }
|
||||
TestMemPoolEntryHelper &HadNoDependencies(bool _hnd) { hadNoDependencies = _hnd; return *this; }
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user