6#include <chainparams.h>
16#include <boost/test/unit_test.hpp>
25 tx.
vin[0].scriptSig.resize(10);
27 tx.
vout[0].nValue = 42;
39 block.
nBits = 0x207fffff;
42 tx.
vin[0].prevout.n = 0;
46 for (
size_t i = 0; i < tx.
vin.size(); i++) {
48 tx.
vin[i].prevout.n = 0;
288 block.
nBits = 0x207fffff;
325 mtx.vin[0].prevout.n = 0;
336 std::vector<std::pair<Wtxid, CTransactionRef>>
extra_txn;
403 req1.indexes.resize(4);
427 req0.indexes.resize(1);
428 req0.indexes[0] = 0xffff;
445 req0.indexes.resize(3);
446 req0.indexes[0] = 0x7000;
447 req0.indexes[1] = 0x10000 - 0x7000 - 2;
TryAddToMempool(pool, CTxMemPoolEntry(tx, fee, 0, 1, 0, false, 4, lp))
static CBlock BuildBlockTestCase(FastRandomContext &ctx)
BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
const std::vector< std::pair< Wtxid, CTransactionRef > > empty_extra_txn
constexpr long SHARED_TX_OFFSET
static CMutableTransaction BuildTransactionTestCase()
const CChainParams & Params()
Return the currently selected parameters.
#define Assert(val)
Identity function.
uint64_t GetShortID(const Wtxid &wtxid) const
std::vector< CTransactionRef > vtx
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
void check(const CCoinsViewCache &active_coins_tip, int64_t spendheight) const EXCLUSIVE_LOCKS_REQUIRED(void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs)
If sanity-checking is turned on, check makes sure the pool is consistent (does not contain two transa...
CTransactionRef get(const Txid &hash) const
Return a mempool transaction with a given hash.
unsigned long size() const
Double ended buffer combining vector and stream-like interfaces.
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
PartiallyDownloadedBlock(CTxMemPool *poolIn)
ReadStatus FillBlock(CBlock &block, const std::vector< CTransactionRef > &vtx_missing, bool segwit_active)
bool IsTxAvailable(size_t index) const
ReadStatus InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, const std::vector< std::pair< Wtxid, CTransactionRef > > &extra_txn)
uint256 rand256() noexcept
generate a random uint256.
TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs &orig)
std::vector< uint64_t > shorttxids
std::vector< PrefilledTransaction > prefilledtxn
TestHeaderAndShortIDs(const CBlock &block, FastRandomContext &ctx)
uint64_t GetShortID(const Wtxid &txhash) const
SERIALIZE_METHODS(TestHeaderAndShortIDs, obj)
std::string ToString() const
static transaction_identifier FromUint256(const uint256 &id)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EXCEPTION(HTTPHeaders{}.Read(reader), std::runtime_error, HasReason{"Empty HTTP header name"})
@ REPLACED
Removed for replacement.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params ¶ms)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
std::shared_ptr< const CTransaction > CTransactionRef
void WriteCompactSize(SizeComputer &os, uint64_t nSize)
static Wrapper< Formatter, T & > Using(T &&t)
Cause serialization/deserialization of an object to be done using a specified formatter class.
A mutable version of CTransaction.
std::vector< CTxOut > vout
Identical to TestingSetup, but chain set to regtest.
CTxMemPoolEntry FromTx(const CMutableTransaction &tx) const
size_t GetExtraCount() const
size_t GetMempoolCount() const
std::unique_ptr< CTxMemPool > mempool
BOOST_CHECK_NE(OneL.ToString(), ArrayToString(ZeroArray, 32))
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.