6#ifndef VERIBLOCK_POP_CPP_C_POP_CONTEXT_H
7#define VERIBLOCK_POP_CPP_C_POP_CONTEXT_H
11#include "veriblock/pop/c/config.h"
12#include "veriblock/pop/c/entities/altblock.h"
13#include "veriblock/pop/c/entities/block_index.h"
14#include "veriblock/pop/c/entities/pop_payouts.h"
15#include "veriblock/pop/c/entities/popdata.h"
16#include "veriblock/pop/c/storage.h"
17#include "veriblock/pop/c/type_helpers.h"
18#include "veriblock/pop/c/validation_state.h"
24POP_DECLARE_ENTITY(pop_context);
26POP_ENTITY_NEW_FUNCTION(pop_context,
27 const POP_ENTITY_NAME(config) * config,
28 const POP_ENTITY_NAME(storage) * storage,
29 POP_ARRAY_NAME(
string) log_lvl);
41POP_ENTITY_CUSTOM_FUNCTION(pop_context,
44 const POP_ENTITY_NAME(alt_block) * block,
45 POP_ENTITY_NAME(validation_state) * state);
56POP_ENTITY_CUSTOM_FUNCTION(pop_context,
59 POP_ARRAY_NAME(u8) hash,
60 const POP_ENTITY_NAME(pop_data) * pop_data);
75POP_ENTITY_CUSTOM_FUNCTION(pop_context,
78 POP_ARRAY_NAME(u8) hash,
79 POP_ENTITY_NAME(validation_state) * state);
95POP_ENTITY_CUSTOM_FUNCTION(pop_context,
98 POP_ARRAY_NAME(u8) A_block_hash,
99 POP_ARRAY_NAME(u8) B_block_hash);
115POP_ENTITY_CUSTOM_FUNCTION(pop_context,
116 POP_ARRAY_NAME(pop_payout),
118 POP_ARRAY_NAME(u8) hash,
119 POP_ENTITY_NAME(validation_state) * state);
128POP_ENTITY_CUSTOM_FUNCTION(pop_context,
131 POP_ARRAY_NAME(u8) hash);
142POP_ENTITY_CUSTOM_FUNCTION(pop_context,
143 POP_ENTITY_NAME(alt_block_index) *,
145 POP_ARRAY_NAME(u8) hash,
146 POP_ENTITY_NAME(validation_state) * state);
157POP_ENTITY_CUSTOM_FUNCTION(pop_context,
158 POP_ENTITY_NAME(vbk_block_index) *,
160 POP_ARRAY_NAME(u8) hash,
161 POP_ENTITY_NAME(validation_state) * state);
172POP_ENTITY_CUSTOM_FUNCTION(pop_context,
173 POP_ENTITY_NAME(btc_block_index) *,
175 POP_ARRAY_NAME(u8) hash,
176 POP_ENTITY_NAME(validation_state) * state);
185POP_ENTITY_CUSTOM_FUNCTION(pop_context,
186 POP_ENTITY_NAME(alt_block_index) *,
196POP_ENTITY_CUSTOM_FUNCTION(pop_context,
197 POP_ENTITY_NAME(vbk_block_index) *,
207POP_ENTITY_CUSTOM_FUNCTION(pop_context,
208 POP_ENTITY_NAME(btc_block_index) *,
217POP_ENTITY_CUSTOM_FUNCTION(pop_context,
218 POP_ENTITY_NAME(alt_block_index) *,
219 alt_get_bootstrap_block);
227POP_ENTITY_CUSTOM_FUNCTION(pop_context,
228 POP_ENTITY_NAME(vbk_block_index) *,
229 vbk_get_bootstrap_block);
237POP_ENTITY_CUSTOM_FUNCTION(pop_context,
238 POP_ENTITY_NAME(btc_block_index) *,
239 btc_get_bootstrap_block);
250POP_ENTITY_CUSTOM_FUNCTION(pop_context,
251 POP_ENTITY_NAME(alt_block_index) *,
252 alt_get_block_at_active_chain,
264POP_ENTITY_CUSTOM_FUNCTION(pop_context,
265 POP_ENTITY_NAME(vbk_block_index) *,
266 vbk_get_block_at_active_chain,
278POP_ENTITY_CUSTOM_FUNCTION(pop_context,
279 POP_ENTITY_NAME(btc_block_index) *,
280 btc_get_block_at_active_chain,
283POP_ENTITY_CUSTOM_FUNCTION(pop_context,
284 POP_ARRAY_NAME(array_u8),
285 get_payload_containing_blocks,
286 POP_ARRAY_NAME(u8)
id);