6#ifndef VERIBLOCK_POP_CPP_KEYSTONE_CONTAINER_HPP
7#define VERIBLOCK_POP_CPP_KEYSTONE_CONTAINER_HPP
12#include <veriblock/pop/blockchain/block_index.hpp>
13#include <veriblock/pop/entities/altblock.hpp>
15#include "veriblock/pop/json.hpp"
16#include "veriblock/pop/strutil.hpp"
23template <
typename Block>
33 std::vector<uint8_t> firstPreviousKeystone;
34 std::vector<uint8_t> secondPreviousKeystone;
37 const uint32_t keystoneInterval);
41 size_t estimateSize()
const;
44 return firstPreviousKeystone == o.firstPreviousKeystone &&
45 secondPreviousKeystone == o.secondPreviousKeystone;
55template <
typename JsonValue>
57 auto obj = json::makeEmptyObject<JsonValue>();
59 obj,
"firstPreviousKeystone",
HexStr(c.firstPreviousKeystone));
61 obj,
"secondPreviousKeystone",
HexStr(c.secondPreviousKeystone));
Class that is used for storing validation state.
Binary writer that is useful for binary serialization.
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.
A container for two previous keystones of endorsed block.
Binary reading stream, that is useful during binary deserialization.