Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.h
// Copyright (c) 2015-2016 The Bitcoin Core developers | // Copyright (c) 2015-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_TEST_TEST_BITCOIN_H | #ifndef BITCOIN_TEST_TEST_BITCOIN_H | ||||
#define BITCOIN_TEST_TEST_BITCOIN_H | #define BITCOIN_TEST_TEST_BITCOIN_H | ||||
#include <amount.h> | |||||
#include <chainparamsbase.h> | #include <chainparamsbase.h> | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <key.h> | #include <key.h> | ||||
#include <primitives/transaction.h> | |||||
#include <pubkey.h> | #include <pubkey.h> | ||||
#include <random.h> | #include <random.h> | ||||
#include <scheduler.h> | #include <scheduler.h> | ||||
#include <txmempool.h> | |||||
/** | /** | ||||
* Version of Boost::test prior to 1.64 have issues when dealing with nullptr_t. | * Version of Boost::test prior to 1.64 have issues when dealing with nullptr_t. | ||||
* In order to work around this, we ensure that the null pointers are typed in a | * In order to work around this, we ensure that the null pointers are typed in a | ||||
* way that Boost will like better. | * way that Boost will like better. | ||||
* | * | ||||
* TODO: Use nullptr directly once the minimum version of boost is 1.64 or more. | * TODO: Use nullptr directly once the minimum version of boost is 1.64 or more. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | struct TestChain100Setup : public TestingSetup { | ||||
// For convenience, coinbase transactions. | // For convenience, coinbase transactions. | ||||
std::vector<CTransactionRef> m_coinbase_txns; | std::vector<CTransactionRef> m_coinbase_txns; | ||||
// private/public key needed to spend coinbase transactions. | // private/public key needed to spend coinbase transactions. | ||||
CKey coinbaseKey; | CKey coinbaseKey; | ||||
}; | }; | ||||
class CTxMemPoolEntry; | class CTxMemPoolEntry; | ||||
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 nSigOpCount; | unsigned int nSigOpCount; | ||||
LockPoints lp; | |||||
TestMemPoolEntryHelper() | TestMemPoolEntryHelper() | ||||
: nFee(), nTime(0), nHeight(1), spendsCoinbase(false), nSigOpCount(1) {} | : 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 | ||||
Show All 32 Lines |