6#ifndef ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_ATV_HPP_
7#define ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_ATV_HPP_
14#include "vbk_merkle_path.hpp"
15#include "vbkblock.hpp"
17#include "veriblock/pop/blob.hpp"
19#include "veriblock/pop/json.hpp"
20#include "veriblock/pop/serde.hpp"
21#include "veriblock/pop/type_traits.hpp"
22#include "veriblock/pop/uint.hpp"
56 std::string toShortPrettyString()
const;
79 static const std::string& name() {
return _name; }
81 friend bool operator==(
const ATV& a,
const ATV& b) {
85 friend bool operator!=(
const ATV& a,
const ATV& b) {
return !(a == b); }
87 friend bool operator<(
const ATV& a,
const ATV& b) {
88 return a.blockOfProof.getHeight() < b.blockOfProof.getHeight();
92 static const std::string _name;
97struct IsPopPayload<ATV> {
98 static const bool value =
true;
102template <
typename JsonValue>
103JsonValue ToJSON(
const ATV& atv) {
104 JsonValue obj = json::makeEmptyObject<JsonValue>();
105 json::putIntKV(obj,
"version", atv.
version);
106 json::putKV(obj,
"transaction", ToJSON<JsonValue>(atv.
transaction));
107 json::putKV(obj,
"merklePath", ToJSON<JsonValue>(atv.
merklePath));
108 json::putKV(obj,
"blockOfProof", ToJSON<JsonValue>(atv.
blockOfProof));
112 json::putStringKV(obj,
"id", atv.
getId().toHex());
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...
Blob< SHA256_HASH_SIZE > uint256
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string SerializeToHex(const T &obj)
Serialize to HEX VBK encoding.
uint32_t version
ATV serialization version.
std::vector< uint8_t > toVbkEncoding() const
Convert ATV to raw bytes data using Vbk byte format.
id_t getId() const
Calculate a ATV id that is the sha256 hash of the ATV rawBytes.
std::string toPrettyString() const
create pretty string
void toVbkEncoding(WriteStream &stream) const
Convert ATV to data stream using Vbk byte format.
VbkTx transaction
endorsing transaction.
bool checked
(memory only) indicates whether we already did 'checkATV' on this ATV
size_t estimateSize() const
Estimate serialization size.
VbkMerklePath merklePath
merkle path that proves that endorsing transaction is in blockOfProof.
VbkBlock blockOfProof
VBK block which contains endorsing transaction.
Binary reading stream, that is useful during binary deserialization.
Path in Merkle tree, which proves that subject exists in the tree.
Veriblock transaction, which endorses ALT block in VBK blockchain.