15#include <test/util/random.h>
16#include <test/util/setup_common.h>
18#include <boost/test/unit_test.hpp>
31 for (
size_t i = 0; i < 10; i++) {
34 ProofPool::AddProofStatus::SUCCEED);
51 std::vector<ProofRef>
proofs;
52 for (
size_t i = 0; i < 10; i++) {
56 ProofPool::AddProofStatus::SUCCEED);
61 for (
size_t j = 0;
j < 10;
j++) {
63 ProofPool::AddProofStatus::DUPLICATED);
67 proofs.push_back(std::move(proof));
82 ProofPool::AddProofStatus::SUCCEED);
89 ProofPool::AddProofStatus::REJECTED);
94 for (
size_t i = 0; i < 10; i++) {
100 for (
auto proof :
proofs) {
125 std::set<ProofRef, ProofRefComparatorByAddress>
poolProofs;
126 for (
size_t i = 0; i < 10; i++) {
129 ProofPool::AddProofStatus::SUCCEED);
138 std::set<ProofRef, ProofRefComparatorByAddress>
pmProofs;
159 pb.addUTXO(outpoint, 10 *
COIN, 123456,
false, key));
174 ProofPool::AddProofStatus::SUCCEED);
180 ProofPool::AddProofStatus::SUCCEED);
186 ProofPool::AddProofStatus::SUCCEED);
202 ProofPool::AddProofStatus::REJECTED);
217 ProofPool::AddProofStatus::SUCCEED);
247 ProofPool::AddProofStatus::SUCCEED);
273 ProofPool::AddProofStatus::DUPLICATED);
282 ProofPool::AddProofStatus::DUPLICATED);
291 ProofPool::AddProofStatus::REJECTED);
300 ProofPool::AddProofStatus::REJECTED);
309 ProofPool::AddProofStatus::REJECTED);
318 ProofPool::AddProofStatus::SUCCEED);
326 for (
size_t i = 0; i < 10; i++) {
332 for (
size_t i = 0; i < 10; i++) {
335 ProofPool::AddProofStatus::SUCCEED);
359 BOOST_CHECK(
pb.addUTXO(outpoint, amount, 123456,
false, key));
365 for (
int i = 9; i >= 0; i--) {
368 ProofPool::AddProofStatus::SUCCEED);
380 for (
size_t i = 1; i < 10; i++) {
383 ProofPool::AddProofStatus::SUCCEED);
395 for (
size_t i = 0; i < 2; i++) {
static constexpr Amount COIN
#define Assert(val)
Identity function.
void ForceSetArg(const std::string &strArg, const std::string &strValue)
void ClearForcedArg(const std::string &strArg)
Remove a forced arg setting, used only in testing.
An encapsulated secp256k1 private key.
static CKey MakeCompressedKey()
Produce a valid compressed key.
An outpoint - a combination of a transaction hash and an index n into its vout.
Chainstate stores and provides an API to update our local knowledge of the current best chain.
Map a proof to each utxo.
std::set< ProofRef, ConflictingProofComparator > ConflictingProofSet
static constexpr Amount PROOF_DUST_THRESHOLD
Minimum amount per utxo.
const CScript UNSPENDABLE_ECREG_PAYOUT_SCRIPT
ProofRef buildRandomProof(Chainstate &active_chainstate, uint32_t score, int height, const CKey &masterKey)
constexpr uint32_t MIN_VALID_PROOF_SCORE
std::unordered_set< ProofId, SaltedProofIdHasher > ProofIdSet
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(get_proof_ids)
uint256 GetRandHash() noexcept
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
A TxId is the identifier of a transaction.