veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
alt_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_ALT_COMMAND_GROUP_PROVIDER_HPP
7#define VERIBLOCK_POP_CPP_ALT_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/altblock.hpp>
12#include <veriblock/pop/entities/popdata.hpp>
13#include <veriblock/pop/storage/payloads_provider.hpp>
14
15namespace altintegration {
16
17struct AltBlockTree;
18
24 using command_groups_t = std::vector<std::unique_ptr<CommandGroup>>;
25
27 : _tree(tree), _payloadStore(payloadStore) {}
28
37 template <typename Payload>
38 std::unique_ptr<CommandGroup> getCommand(const BlockIndex<AltBlock>& block,
39 const typename Payload::id_t& id,
40 ValidationState& state);
41
50 std::unique_ptr<command_groups_t> getCommands(
51 const BlockIndex<AltBlock>& block, ValidationState& state);
52
53 private:
54 AltBlockTree& _tree;
55 PayloadsStorage& _payloadStore;
56};
57
58} // namespace altintegration
59
60#endif // VERIBLOCK_POP_CPP_ALT_COMMAND_GROUP_PROVIDER_HPP
Class that is used for storing validation state.
Defines logging helpers.
Definition: block.hpp:14
Represents simplified view on Altchain's block tree, maintains VBK tree and BTC tree.
A wrapper for the payload store that constructs command objects.
std::unique_ptr< CommandGroup > getCommand(const BlockIndex< AltBlock > &block, const typename Payload::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< AltBlock > &block, ValidationState &state)
Get command groups for a particular block.
A node in a block tree.
Definition: block_index.hpp:31
Accessor for ATV/VTB/VbkBlock bodies given hash.