veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
vbkblock.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_ENTITIES_VBKBLOCK_H
7#define VERIBLOCK_POP_CPP_C_ENTITIES_VBKBLOCK_H
8
9#include "veriblock/pop/c/array.h"
10#include "veriblock/pop/c/entities/serde.h"
11#include "veriblock/pop/c/type_helpers.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17POP_DECLARE_ENTITY(config);
18
19POP_DECLARE_ENTITY(vbk_block);
20
21POP_ENTITY_GETTER_FUNCTION(vbk_block, POP_ARRAY_NAME(u8), id);
22POP_ENTITY_GETTER_FUNCTION(vbk_block, POP_ARRAY_NAME(u8), hash);
23POP_ENTITY_GETTER_FUNCTION(vbk_block, POP_ARRAY_NAME(u8), previous_block);
24POP_ENTITY_GETTER_FUNCTION(vbk_block, POP_ARRAY_NAME(u8), merkle_root);
25POP_ENTITY_GETTER_FUNCTION(vbk_block, POP_ARRAY_NAME(u8), previous_keystone);
26POP_ENTITY_GETTER_FUNCTION(vbk_block,
27 POP_ARRAY_NAME(u8),
28 second_previous_keystone);
29POP_ENTITY_GETTER_FUNCTION(vbk_block, int16_t, version);
30POP_ENTITY_GETTER_FUNCTION(vbk_block, uint32_t, timestamp);
31POP_ENTITY_GETTER_FUNCTION(vbk_block, int32_t, difficulty);
32POP_ENTITY_GETTER_FUNCTION(vbk_block, uint64_t, nonce);
33POP_ENTITY_GETTER_FUNCTION(vbk_block, int32_t, height);
34
35POP_ENTITY_TO_JSON(vbk_block);
36
37POP_ENTITY_SERIALIZE_TO_VBK(vbk_block);
38POP_ENTITY_DESERIALIZE_FROM_VBK(vbk_block);
39
40POP_DECLARE_ARRAY(POP_ENTITY_NAME(vbk_block) *, vbk_block);
41
42POP_GENERATE_DEFAULT_VALUE(vbk_block);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif