 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
13 #include <boost/test/unit_test.hpp>
15 std::vector<std::pair<uint256, CTransactionRef>>
extra_txn;
23 tx.
vin[0].scriptSig.resize(10);
25 tx.
vout[0].nValue = 42;
31 block.
nBits = 0x207fffff;
34 tx.
vin[0].prevout.n = 0;
38 for (
size_t i = 0; i < tx.
vin.size(); i++) {
40 tx.
vin[i].prevout.n = 0;
83 size_t poolSize = pool.
size();
199 txhash = block.
vtx[2]->GetHash();
251 txhash = block.
vtx[1]->GetHash();
263 coinbase.
vin.resize(1);
264 coinbase.
vin[0].scriptSig.resize(10);
265 coinbase.
vout.resize(1);
266 coinbase.
vout[0].nValue = 42;
273 block.
nBits = 0x207fffff;
295 std::vector<CTransactionRef> vtx_missing;
350 req0.
indexes[1] = 0x10000 - 0x7000 - 2;
366 }
catch(std::ios_base::failure &) {
Identical to TestingSetup, but chain set to regtest.
std::string ToString(const T &t)
Locale-independent version of std::to_string.
BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
ReadStatus FillBlock(CBlock &block, const std::vector< CTransactionRef > &vtx_missing)
std::vector< uint64_t > shorttxids
std::vector< std::pair< uint256, CTransactionRef > > extra_txn
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
static uint256 InsecureRand256()
uint64_t GetShortID(const uint256 &txhash) const
static CTransactionRef MakeTransactionRef(Tx &&txIn)
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.
std::vector< PrefilledTransaction > prefilledtxn
#define BOOST_FIXTURE_TEST_SUITE(a, b)
BOOST_AUTO_TEST_SUITE_END()
bool IsTxAvailable(size_t index) const
ReadStatus InitData(const CBlockHeaderAndShortTxIDs &cmpctblock, const std::vector< std::pair< uint256, CTransactionRef >> &extra_txn)
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
void WriteCompactSize(CSizeComputer &os, uint64_t nSize)
SERIALIZE_METHODS(TestHeaderAndShortIDs, obj)
constexpr long SHARED_TX_OFFSET
TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs &orig)
std::string ToString() const
@ REPLACED
Removed for replacement.
std::vector< uint16_t > indexes
TestHeaderAndShortIDs(const CBlock &block)
std::vector< CTxOut > vout
std::vector< CTransactionRef > vtx
uint64_t GetShortID(const uint256 &txhash) const
void check(const CCoinsViewCache &active_coins_tip, int64_t spendheight) const EXCLUSIVE_LOCKS_REQUIRED(void addUnchecked(const CTxMemPoolEntry &entry, bool validFeeEstimate=true) EXCLUSIVE_LOCKS_REQUIRED(cs
If sanity-checking is turned on, check makes sure the pool is consistent (does not contain two transa...
unsigned long size() const
const CChainParams & Params()
Return the currently selected parameters.
Double ended buffer combining vector and stream-like interfaces.
CTxMemPoolEntry FromTx(const CMutableTransaction &tx) const
A mutable version of CTransaction.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static Wrapper< Formatter, T & > Using(T &&t)
Cause serialization/deserialization of an object to be done using a specified formatter class.
#define BOOST_CHECK(expr)
static CBlock BuildBlockTestCase()
#define BOOST_CHECK_EQUAL(v1, v2)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs)
static const int PROTOCOL_VERSION
network protocol versioning