veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altblock.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_ALTBLOCK_H
7#define VERIBLOCK_POP_CPP_C_ENTITIES_ALTBLOCK_H
8
9#include <stdbool.h>
10
11#include "veriblock/pop/c/array.h"
12#include "veriblock/pop/c/entities/serde.h"
13#include "veriblock/pop/c/type_helpers.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19POP_DECLARE_ENTITY(config);
20
21POP_DECLARE_ENTITY(alt_block);
22
23POP_ENTITY_NEW_FUNCTION(alt_block,
24 POP_ARRAY_NAME(u8) hash,
25 POP_ARRAY_NAME(u8) previous_block,
26 uint32_t timestamp,
27 int32_t height);
28
29POP_ENTITY_GETTER_FUNCTION(alt_block, POP_ARRAY_NAME(u8), hash);
30POP_ENTITY_GETTER_FUNCTION(alt_block, POP_ARRAY_NAME(u8), previous_block);
31POP_ENTITY_GETTER_FUNCTION(alt_block, uint32_t, timestamp);
32POP_ENTITY_GETTER_FUNCTION(alt_block, int32_t, height);
33
34POP_ENTITY_TO_JSON(alt_block, bool reverseHashes);
35
36POP_ENTITY_SERIALIZE_TO_VBK(alt_block);
37POP_ENTITY_DESERIALIZE_FROM_VBK(alt_block, POP_ENTITY_NAME(config) *);
38
39POP_GENERATE_DEFAULT_VALUE(alt_block);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif