Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.h
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
class CTxMemPool; | class CTxMemPool; | ||||
struct TestMemPoolEntryHelper { | struct TestMemPoolEntryHelper { | ||||
// Default values | // Default values | ||||
Amount nFee; | Amount nFee; | ||||
int64_t nTime; | int64_t nTime; | ||||
unsigned int nHeight; | unsigned int nHeight; | ||||
bool spendsCoinbase; | bool spendsCoinbase; | ||||
unsigned int sigOpCost; | unsigned int nSigOpCount; | ||||
LockPoints lp; | LockPoints lp; | ||||
TestMemPoolEntryHelper() | TestMemPoolEntryHelper() | ||||
: nFee(), nTime(0), nHeight(1), spendsCoinbase(false), sigOpCost(4) {} | : nFee(), nTime(0), nHeight(1), spendsCoinbase(false), nSigOpCount(1) {} | ||||
CTxMemPoolEntry FromTx(const CMutableTransaction &tx); | CTxMemPoolEntry FromTx(const CMutableTransaction &tx); | ||||
CTxMemPoolEntry FromTx(const CTransactionRef &tx); | CTxMemPoolEntry FromTx(const CTransactionRef &tx); | ||||
// Change the default value | // Change the default value | ||||
TestMemPoolEntryHelper &Fee(Amount _fee) { | TestMemPoolEntryHelper &Fee(Amount _fee) { | ||||
nFee = _fee; | nFee = _fee; | ||||
return *this; | return *this; | ||||
} | } | ||||
TestMemPoolEntryHelper &Time(int64_t _time) { | TestMemPoolEntryHelper &Time(int64_t _time) { | ||||
nTime = _time; | nTime = _time; | ||||
return *this; | return *this; | ||||
} | } | ||||
TestMemPoolEntryHelper &Height(unsigned int _height) { | TestMemPoolEntryHelper &Height(unsigned int _height) { | ||||
nHeight = _height; | nHeight = _height; | ||||
return *this; | return *this; | ||||
} | } | ||||
TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { | TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { | ||||
spendsCoinbase = _flag; | spendsCoinbase = _flag; | ||||
return *this; | return *this; | ||||
} | } | ||||
TestMemPoolEntryHelper &SigOpsCost(unsigned int _sigopsCost) { | TestMemPoolEntryHelper &SigOpCount(unsigned int _nSigOpCount) { | ||||
sigOpCost = _sigopsCost; | nSigOpCount = _nSigOpCount; | ||||
return *this; | return *this; | ||||
} | } | ||||
}; | }; | ||||
enum class ScriptError; | enum class ScriptError; | ||||
// define implicit conversions here so that these types may be used in | // define implicit conversions here so that these types may be used in | ||||
// BOOST_*_EQUAL | // BOOST_*_EQUAL | ||||
std::ostream &operator<<(std::ostream &os, const uint256 &num); | std::ostream &operator<<(std::ostream &os, const uint256 &num); | ||||
std::ostream &operator<<(std::ostream &os, const ScriptError &err); | std::ostream &operator<<(std::ostream &os, const ScriptError &err); | ||||
CBlock getBlock13b8a(); | CBlock getBlock13b8a(); | ||||
#endif // BITCOIN_TEST_TEST_BITCOIN_H | #endif // BITCOIN_TEST_TEST_BITCOIN_H |