6#ifndef ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_MERKLE_PATH_HPP_
7#define ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_MERKLE_PATH_HPP_
15#include "veriblock/pop/hashutil.hpp"
16#include "veriblock/pop/json.hpp"
17#include "veriblock/pop/serde.hpp"
18#include "veriblock/pop/strutil.hpp"
19#include "veriblock/pop/uint.hpp"
34 std::vector<uint256> layers{};
48 size_t estimateSize()
const;
58template <
typename JsonValue>
60 JsonValue obj = json::makeEmptyObject<JsonValue>();
61 json::putIntKV(obj,
"index", m.index);
62 json::putStringKV(obj,
"subject",
HexStr(m.subject));
63 json::putArrayKV(obj,
"layers", m.layers);
Class that is used for storing validation state.
Binary writer that is useful for binary serialization.
All constants in alt-cpp.
bool DeserializeFromRaw(ReadStream &stream, AltBlock &out, ValidationState &state, const AltBlock::hash_t &=AltBlock::hash_t{})
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool DeserializeFromVbkEncoding(ReadStream &stream, AltBlockAddon &out, ValidationState &state)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string HexStr(const T itbegin, const T itend)
Convert bytes to hex.
Path in Merkle tree which proves that subject is inside this tree.
void toRaw(WriteStream &stream) const
Convert MerklePath to data stream using MerklePath basic byte format.
uint256 calculateMerkleRoot() const
Calculate the hash of the merkle root.
void toVbkEncoding(WriteStream &stream) const
Convert MerklePath to data stream using MerklePath VBK byte format.
Binary reading stream, that is useful during binary deserialization.