6#ifndef ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_VBK_MERKLE_PATH_HPP_
7#define ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_VBK_MERKLE_PATH_HPP_
14#include "veriblock/pop/hashutil.hpp"
15#include "veriblock/pop/json.hpp"
16#include "veriblock/pop/serde.hpp"
17#include "veriblock/pop/uint.hpp"
45 size_t estimateSize()
const;
61template <
typename JsonValue>
63 JsonValue obj = json::makeEmptyObject<JsonValue>();
64 json::putIntKV(obj,
"treeIndex", mp.
treeIndex);
65 json::putIntKV(obj,
"index", mp.
index);
66 json::putStringKV(obj,
"subject", mp.
subject.toHex());
67 json::putArrayKV(obj,
"layers", mp.
layers);
Class that is used for storing validation state.
Binary writer that is useful for binary serialization.
All constants in alt-cpp.
bool DeserializeFromVbkEncoding(ReadStream &stream, AltBlockAddon &out, ValidationState &state)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Binary reading stream, that is useful during binary deserialization.
Path in Merkle tree, which proves that subject exists in the tree.
int32_t treeIndex
an indentifier of which transactions tree (pop=0, normal=1)
std::vector< uint256 > layers
the layers in the merkle path
int32_t index
the index of the bottom data TxID in the block it came from
uint128 calculateMerkleRoot() const
Calculate the hash of the vb merkle root.
void toVbkEncoding(WriteStream &stream) const
Convert VbkMerklePath to data stream using VbkMerklePath VBK byte format.
uint256 subject
TxID that this merkle path authenticates.
std::vector< uint32_t > equalLayerIndexes() const
Return layer indexes where left and right nodes are equal.