5 #ifndef PIVX_TEST_TEST_PIVX_H
6 #define PIVX_TEST_TEST_PIVX_H
14 #include <boost/thread.hpp>
93 std::shared_ptr<CBlock>
FinalizeBlock(std::shared_ptr<CBlock> pblock);
111 bool fNoMempoolTx =
true,
112 bool fTestBlockValidity =
true,
113 bool fIncludeQfc =
true,
115 CBlock CreateBlock(
const std::vector<CMutableTransaction>& txns,
const CKey& scriptKey,
bool fTestBlockValidity =
true);
174 return std::string(e.what()).find(
m_reason) != std::string::npos;
int64_t CAmount
Amount in PIV (Can be negative)
CBaseChainParams defines the base parameters (shared between pivx-cli and pivxd) of a given instance ...
static const std::string MAIN
Chain name strings.
The block chain is a tree shaped structure starting with the genesis block at the root,...
An encapsulated private key.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
Users of this module must hold an ECCVerifyHandle.
uint32_t rand32() noexcept
Generate a random 32-bit integer.
uint16_t rand16()
Generate a random 16-bit integer.
uint256 rand256() noexcept
generate a random uint256.
bool randbool() noexcept
Generate a random boolean.
std::vector< unsigned char > randbytes(size_t len)
Generate random bytes.
uint64_t randbits(int bits) noexcept
Generate a random (bits)-bit integer.
uint64_t randrange(uint64_t range) noexcept
Generate a random integer in the range [0..range).
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
HasReason(const std::string &reason)
const std::string m_reason
bool operator()(const std::exception &e) const
BasicTestingSetup(const std::string &chainName=CBaseChainParams::MAIN)
fs::path SetDataDir(const std::string &name)
ECCVerifyHandle globalVerifyHandle
const fs::path m_path_root
A mutable version of CTransaction.
TestChainSetup(int blockCount)
std::vector< CTransaction > coinbaseTxns
CBlock CreateBlock(const std::vector< CMutableTransaction > &txns, const CScript &scriptPubKey, bool fNoMempoolTx=true, bool fTestBlockValidity=true, bool fIncludeQfc=true, CBlockIndex *customPrevBlock=nullptr)
CBlock CreateAndProcessBlock(const std::vector< CMutableTransaction > &txns, const CScript &scriptPubKey, bool fNoMempoolTx=true)
TestMemPoolEntryHelper & SigOps(unsigned int _sigops)
TestMemPoolEntryHelper & SpendsCoinbaseOrCoinstake(bool _flag)
bool spendsCoinbaseOrCoinstake
TestMemPoolEntryHelper & Height(unsigned int _height)
TestMemPoolEntryHelper & Time(int64_t _time)
TestMemPoolEntryHelper & Fee(CAmount _fee)
CTxMemPoolEntry FromTx(const CMutableTransaction &tx)
EvoNotificationInterface * pEvoNotificationInterface
TestingSetup(const std::string &chainName=CBaseChainParams::MAIN)
boost::thread_group threadGroup
std::unique_ptr< PeerLogicValidation > peerLogic
std::ostream & operator<<(std::ostream &os, const uint256 &num)
@ ZEROS
Seed with a compile time constant of zeros.
@ SEED
Call the Seed() helper.
bool g_mock_deterministic_tests
Flag to make GetRand in random.h return the same number.
std::shared_ptr< CBlock > FinalizeBlock(std::shared_ptr< CBlock > pblock)
void Seed(FastRandomContext &ctx)
Seed the given random ctx or use the seed passed in via an environment var.
FastRandomContext g_insecure_rand_ctx