5#ifndef BITCOIN_AVALANCHE_COMPACTPROOFS_H
6#define BITCOIN_AVALANCHE_COMPACTPROOFS_H
25 struct TestCompactProofs;
46 return lhs->getId() ==
rhs->getId();
73 std::pair<uint64_t, uint64_t>
getKeys()
const {
83 obj.shortproofidk0,
obj.shortproofidk1,
87 obj.prefilledProofs));
97 std::numeric_limits<uint32_t>::max()) {
98 throw std::ios_base::failure(
"indexes overflowed 32 bits");
105 throw std::ios_base::failure(
"non contiguous indexes");
111 friend struct ::avalanche::TestCompactProofs;
SERIALIZE_METHODS(CompactProofs, obj)
std::vector< PrefilledProof > prefilledProofs
const std::vector< PrefilledProof > & getPrefilledProofs() const
uint64_t getShortID(const ProofId &proofid) const
std::pair< uint64_t, uint64_t > getKeys() const
const std::vector< uint64_t > & getShortIDs() const
std::vector< uint64_t > shortproofids
static constexpr int SHORTPROOFIDS_LENGTH
std::vector< uint32_t > indices
SERIALIZE_METHODS(ProofsRequest, obj)
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...
static Wrapper< Formatter, T & > Using(T &&t)
Cause serialization/deserialization of an object to be done using a specified formatter class.
This is a radix tree storing values identified by a unique key.
void UnserData(Stream &s)
avalanche::ProofRef proof
bool operator()(const ProofRef &lhs, const ProofRef &rhs) const
ProofRef getItem(const PrefilledProof &pp) const
uint32_t getIndex(const PrefilledProof &pp) const