13 #include <boost/test/unit_test.hpp>
33 newTx.
sapData->vShieldedSpend.emplace_back();
44 newTx.
sapData->vShieldedSpend.emplace_back();
47 newTx.
sapData->vShieldedOutput.emplace_back();
49 newTx.
sapData->vShieldedSpend.emplace_back();
50 newTx.
sapData->vShieldedSpend[1].nullifier = newTx.
sapData->vShieldedSpend[0].nullifier;
66 newTx.
vin.emplace_back(vin);
69 newTx.
vout.emplace_back(vout);
71 newTx.
sapData->vShieldedSpend.emplace_back();
83 newTx.
vin.emplace_back(vin);
86 newTx.
vout.emplace_back(vout);
88 newTx.
vout.emplace_back(vout);
90 newTx.
sapData->vShieldedSpend.emplace_back();
99 pblock->vtx.emplace_back(MakeTransactionRef(mtx));
114 mempool, state, MakeTransactionRef(mtx),
true,
nullptr,
false,
true));
128 std::unique_ptr<CBlockTemplate> pblocktemplate;
137 mtx.
vin.emplace_back(vin);
140 mtx.
vout.emplace_back();
143 mtx.
vout[0].nValue = 1 * COIN;
144 std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>(pblocktemplate->block);
149 mtx.
vout[0].scriptPubKey = scriptPubKey;
151 pblock = std::make_shared<CBlock>(pblocktemplate->block);
157 pblock = std::make_shared<CBlock>(pblocktemplate->block);
int64_t CAmount
Amount in PIV (Can be negative)
bool SolveBlock(std::shared_ptr< CBlock > &pblock, int nHeight)
Modify the nonce/extranonce in a block.
void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivationHeight)
Allows modifying the network upgrade regtest parameters.
const CChainParams & Params()
Return the currently selected parameters.
BlockStateCatcher & get() const
std::vector< unsigned char > getvch() const
static CBigNum randBignum(const CBigNum &range)
Generates a cryptographically secure random number between zero and range exclusive i....
uint256 GetBlockHash() const
CBlockIndex * Tip(bool fProofOfStake=false) const
Returns the index entry for the tip of this chain, or nullptr if none.
CChainParams defines various tweakable parameters of a given instance of the PIVX system.
const Consensus::Params & GetConsensus() const
An outpoint - a combination of a transaction hash and an index n into its vout.
Serialized script, used inside transaction inputs and outputs.
An input of a transaction.
An output of a transaction.
Capture information about block/transaction validation.
std::string GetRejectReason() const
CBigNum groupOrder
The order of the group.
IntegerGroupParams coinCommitmentGroup
The Quadratic Residue group from which we form a coin as a commitment to a serial number.
BOOST_AUTO_TEST_SUITE(cuckoocache_tests)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
bool CheckTransactionWithoutProofVerification(const CTransaction &tx, CValidationState &state, CAmount &nValueOut)
RecursiveMutex cs_main
Global state.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
uint256 GetRandHash() noexcept
A mutable version of CTransaction.
Optional< SaplingTxData > sapData
std::vector< CTxOut > vout
static constexpr int ALWAYS_ACTIVE
Special value for nActivationHeight indicating that the upgrade is always active.
libzerocoin::ZerocoinParams * Zerocoin_Params(bool useModulusV1) const
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
bool CheckTransaction(const CTransaction &tx, CValidationState &state, bool fColdStakingActive)
Transaction validation functions.
const uint256 UINT256_ZERO
constant uint256 instances
std::vector< unsigned char > ParseHex(const char *psz)
CTxMemPool mempool(::minRelayTxFee)
bool ProcessNewBlock(const std::shared_ptr< const CBlock > &pblock, const FlatFilePos *dbp)
Process an incoming block.
bool AcceptToMemoryPool(CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, bool fOverrideMempoolLimit, bool fRejectInsaneFee, bool ignoreFees)
(try to) add transaction to memory pool
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
void CheckBlockZcRejection(std::shared_ptr< CBlock > &pblock, int nHeight, CMutableTransaction &mtx, const std::string &expected_msg)
BOOST_FIXTURE_TEST_CASE(test_simple_shielded_invalid, TestingSetup)
void CheckMempoolZcRejection(CMutableTransaction &mtx, const std::string &expected_msg)