veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
utils.h
1// Copyright (c) 2019-2022 Xenios SEZC
2// https://www.veriblock.org
3// Distributed under the MIT software license, see the accompanying
4// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef VERIBLOCK_POP_CPP_C_UTILS_H
7#define VERIBLOCK_POP_CPP_C_UTILS_H
8
9#include <stdbool.h>
10
11#include "veriblock/pop/c/array.h"
12#include "veriblock/pop/c/entities/altblock.h"
13#include "veriblock/pop/c/entities/popdata.h"
14#include "veriblock/pop/c/entities/publication_data.h"
15#include "veriblock/pop/c/pop_context.h"
16#include "veriblock/pop/c/validation_state.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
35POP_ENTITY_CUSTOM_FUNCTION(pop_context,
36 POP_ENTITY_NAME(publication_data) *,
37 generate_publication_data,
38 POP_ARRAY_NAME(u8) endorsed_block_header,
39 POP_ARRAY_NAME(u8) tx_root,
40 POP_ARRAY_NAME(u8) payout_info,
41 const POP_ENTITY_NAME(pop_data) * pop_data);
42
56POP_ENTITY_CUSTOM_FUNCTION(pop_context,
57 POP_ARRAY_NAME(u8),
58 calculate_top_level_merkle_root,
59 POP_ARRAY_NAME(u8) tx_root,
60 POP_ARRAY_NAME(u8) prev_block_hash,
61 const POP_ENTITY_NAME(pop_data) * pop_data);
62
71POP_ENTITY_CUSTOM_FUNCTION(pop_context,
72 bool,
73 save_all_trees,
74 POP_ENTITY_NAME(validation_state) * state);
75
84POP_ENTITY_CUSTOM_FUNCTION(pop_context,
85 bool,
86 load_all_trees,
87 POP_ENTITY_NAME(validation_state) * state);
88
98POP_ENTITY_CUSTOM_FUNCTION(pop_context,
99 bool,
100 check_atv,
101 const POP_ENTITY_NAME(atv) * atv,
102 POP_ENTITY_NAME(validation_state) * state);
103
113POP_ENTITY_CUSTOM_FUNCTION(pop_context,
114 bool,
115 check_vtb,
116 const POP_ENTITY_NAME(vtb) * vtb,
117 POP_ENTITY_NAME(validation_state) * state);
118
129POP_ENTITY_CUSTOM_FUNCTION(pop_context,
130 bool,
131 check_vbk_block,
132 const POP_ENTITY_NAME(vbk_block) * vbk_block,
133 POP_ENTITY_NAME(validation_state) * state);
134
145POP_ENTITY_CUSTOM_FUNCTION(pop_context,
146 bool,
147 check_pop_data,
148 const POP_ENTITY_NAME(pop_data) * pop_data,
149 POP_ENTITY_NAME(validation_state) * state);
150
151#ifdef __cplusplus
152} // end of extern "C"
153#endif
154
155#endif