veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
btcblock.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_BTCBLOCK_H
7#define VERIBLOCK_POP_CPP_C_ENTITIES_BTCBLOCK_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(btc_block);
20
21POP_ENTITY_GETTER_FUNCTION(btc_block, POP_ARRAY_NAME(u8), hash);
22POP_ENTITY_GETTER_FUNCTION(btc_block, POP_ARRAY_NAME(u8), previous_block);
23POP_ENTITY_GETTER_FUNCTION(btc_block, POP_ARRAY_NAME(u8), merkle_root);
24POP_ENTITY_GETTER_FUNCTION(btc_block, uint32_t, version);
25POP_ENTITY_GETTER_FUNCTION(btc_block, uint32_t, timestamp);
26POP_ENTITY_GETTER_FUNCTION(btc_block, uint32_t, difficulty);
27POP_ENTITY_GETTER_FUNCTION(btc_block, uint32_t, nonce);
28
29POP_ENTITY_TO_JSON(btc_block);
30
31POP_ENTITY_SERIALIZE_TO_VBK(btc_block);
32POP_ENTITY_DESERIALIZE_FROM_VBK(btc_block, POP_ENTITY_NAME(config) *);
33
34POP_DECLARE_ARRAY(POP_ENTITY_NAME(btc_block) *, btc_block);
35
36POP_GENERATE_DEFAULT_VALUE(btc_block);
37
38#ifdef __cplusplus
39}
40#endif
41
42#endif // VERIBLOCK_POP_CPP_BTC_BLOCK_H