veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
payloads_provider.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_PAYLOADS_PROVIDER_HPP
7#define VERIBLOCK_POP_CPP_PAYLOADS_PROVIDER_HPP
8
9#include <veriblock/pop/blockchain/blockchain_util.hpp>
10#include <veriblock/pop/entities/altblock.hpp>
11#include <veriblock/pop/entities/popdata.hpp>
12
13namespace altintegration {
14
15struct AltBlockTree;
16struct VbkBlockTree;
17
25 virtual ~PayloadsStorage() = default;
26
29 virtual bool getATV(const ATV::id_t& ids,
30 ATV& out,
31 ValidationState& state) = 0;
34 virtual bool getVTB(const VTB::id_t& ids,
35 VTB& out,
36 ValidationState& state) = 0;
39 virtual bool getVBK(const VbkBlock::id_t& id,
40 VbkBlock& out,
41 ValidationState& state) = 0;
42
44 virtual void writePayloads(const PopData& payloads) = 0;
45
47 bool getPayload(const VbkBlock::id_t& id,
48 VbkBlock& out,
49 ValidationState& state) {
50 return getVBK(id, out, state);
51 }
53 bool getPayload(const VTB::id_t& id, VTB& out, ValidationState& state) {
54 return getVTB(id, out, state);
55 }
57 bool getPayload(const ATV::id_t& id, ATV& out, ValidationState& state) {
58 return getATV(id, out, state);
59 }
60};
61
62} // namespace altintegration
63
64#endif // VERIBLOCK_POP_CPP_PAYLOADS_PROVIDER_HPP
Class that is used for storing validation state.
Defines logging helpers.
Definition: block.hpp:14
Atlchain endorsement.
Definition: atv.hpp:36
Accessor for ATV/VTB/VbkBlock bodies given hash.
virtual bool getATV(const ATV::id_t &ids, ATV &out, ValidationState &state)=0
should write ATV identified by id into out, or return false
bool getPayload(const VTB::id_t &id, VTB &out, ValidationState &state)
alias for getVTB
bool getPayload(const ATV::id_t &id, ATV &out, ValidationState &state)
alias for getATV
virtual bool getVTB(const VTB::id_t &ids, VTB &out, ValidationState &state)=0
should write VTB identified by id into out, or return false
bool getPayload(const VbkBlock::id_t &id, VbkBlock &out, ValidationState &state)
alias for getVBK
virtual bool getVBK(const VbkBlock::id_t &id, VbkBlock &out, ValidationState &state)=0
should write VbkBlock identified by id into out, or return false
Represents ALT block body of POP-related info.
Definition: popdata.hpp:27
Veriblock to Bitcoin publication, committed to Veriblock blockchain in containingBlock.
Definition: vtb.hpp:37
Veriblock block.
Definition: vbkblock.hpp:32