Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tree_meta.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
11#include <cstdint>
12#include <ostream>
13#include <string>
14#include <utility>
15
17
18struct TreeMeta {
19 std::string name;
20 uint32_t depth;
29
31 depth,
32 size,
34 root,
40
41 TreeMeta(std::string n,
42 uint32_t d,
43 const index_t& s,
44 const index_t& c,
45 const bb::fr& r,
46 const index_t& is,
47 const bb::fr& ir,
48 const block_number_t& o,
49 const block_number_t& u,
50 const block_number_t& f)
51 : name(std::move(n))
52 , depth(d)
53 , size(s)
54 , committedSize(c)
55 , root(r)
56 , initialSize(is)
57 , initialRoot(ir)
61 {}
62 TreeMeta() = default;
63 ~TreeMeta() = default;
64 TreeMeta(const TreeMeta& other) = default;
65 TreeMeta(TreeMeta&& other) noexcept { *this = std::move(other); }
66 TreeMeta& operator=(const TreeMeta& other) = default;
67 TreeMeta& operator=(TreeMeta&& other) noexcept = default;
68
69 bool operator==(const TreeMeta& other) const
70 {
71 return name == other.name && depth == other.depth && size == other.size &&
72 committedSize == other.committedSize && root == other.root && initialRoot == other.initialRoot &&
75 }
76};
77
78inline std::ostream& operator<<(std::ostream& os, const TreeMeta& meta)
79{
80 os << "TreeMeta{name: " << meta.name << ", depth: " << meta.depth << ", size: " << std::dec << (meta.size)
81 << ", committedSize: " << std::dec << meta.committedSize << ", root: " << meta.root
82 << ", initialSize: " << std::dec << meta.initialSize << ", initialRoot: " << meta.initialRoot
83 << ", oldestHistoricBlock: " << std::dec << meta.oldestHistoricBlock << ", finalizedBlockHeight: " << std::dec
84 << meta.finalizedBlockHeight << ", unfinalizedBlockHeight: " << std::dec << meta.unfinalizedBlockHeight << "}";
85 return os;
86}
87
88} // namespace bb::crypto::merkle_tree
uint32_t block_number_t
Definition types.hpp:19
std::ostream & operator<<(std::ostream &os, const BlockPayload &block)
STL namespace.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
MSGPACK_FIELDS(name, depth, size, committedSize, root, initialSize, initialRoot, oldestHistoricBlock, unfinalizedBlockHeight, finalizedBlockHeight) TreeMeta(std
Definition tree_meta.hpp:30
TreeMeta & operator=(TreeMeta &&other) noexcept=default
TreeMeta(const TreeMeta &other)=default
TreeMeta(TreeMeta &&other) noexcept
Definition tree_meta.hpp:65
bool operator==(const TreeMeta &other) const
Definition tree_meta.hpp:69
TreeMeta & operator=(const TreeMeta &other)=default