veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
vbk_command_group_store.hpp
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_VBK_COMMAND_GROUP_PROVIDER_HPP
7#define VERIBLOCK_POP_CPP_VBK_COMMAND_GROUP_PROVIDER_HPP
8
9#include <veriblock/pop/blockchain/blockchain_util.hpp>
10#include <veriblock/pop/blockchain/command_group.hpp>
11#include <veriblock/pop/entities/popdata.hpp>
12#include <veriblock/pop/entities/vbkblock.hpp>
13#include <veriblock/pop/storage/payloads_provider.hpp>
14
15namespace altintegration {
16
17struct VbkBlockTree;
18
24 using command_groups_t = std::vector<std::unique_ptr<CommandGroup>>;
25
27 : _tree(tree), _payloadStore(payloadStore) {}
28
37 std::unique_ptr<CommandGroup> getCommand(const BlockIndex<VbkBlock>& block,
38 const VTB::id_t& id,
39 ValidationState& state);
40
49 std::unique_ptr<command_groups_t> getCommands(
50 const BlockIndex<VbkBlock>& block, ValidationState& state);
51
52 private:
53 VbkBlockTree& _tree;
54 PayloadsStorage& _payloadStore;
55};
56
57} // namespace altintegration
58
59#endif // VERIBLOCK_POP_CPP_VBK_COMMAND_GROUP_PROVIDER_HPP
Class that is used for storing validation state.
Defines logging helpers.
Definition: block.hpp:14
A node in a block tree.
Definition: block_index.hpp:31
Accessor for ATV/VTB/VbkBlock bodies given hash.
Veriblock block tree.
A wrapper for the payload store that constructs command objects.
std::unique_ptr< CommandGroup > getCommand(const BlockIndex< VbkBlock > &block, const VTB::id_t &id, ValidationState &state)
Get the command group for the given payload in the given block.
std::unique_ptr< command_groups_t > getCommands(const BlockIndex< VbkBlock > &block, ValidationState &state)
Get command groups for a particular block.