Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/orphanproofpool_tests.cpp
Show All 22 Lines | static ProofRef makeProof(const size_t nStakes) { | ||||
const Amount v = 5 * COIN; | const Amount v = 5 * COIN; | ||||
const int height = 1234; | const int height = 1234; | ||||
ProofBuilder pb(0, 0, CKey::MakeCompressedKey()); | ProofBuilder pb(0, 0, CKey::MakeCompressedKey()); | ||||
for (size_t i = 0; i < nStakes; i++) { | for (size_t i = 0; i < nStakes; i++) { | ||||
TxId txid(GetRandHash()); | TxId txid(GetRandHash()); | ||||
BOOST_CHECK(pb.addUTXO(COutPoint(txid, 0), v, height, false, | BOOST_CHECK(pb.addUTXO(COutPoint(txid, 0), v, height, false, | ||||
CKey::MakeCompressedKey())); | CKey::MakeCompressedKey())); | ||||
} | } | ||||
return std::make_shared<Proof>(pb.build()); | return pb.build(); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(pool_starts_empty) { | BOOST_AUTO_TEST_CASE(pool_starts_empty) { | ||||
OrphanProofPool pool{10}; | OrphanProofPool pool{10}; | ||||
BOOST_CHECK_EQUAL(pool.getNProofs(), 0); | BOOST_CHECK_EQUAL(pool.getNProofs(), 0); | ||||
BOOST_CHECK_EQUAL(pool.getNStakes(), 0); | BOOST_CHECK_EQUAL(pool.getNStakes(), 0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |