6#ifndef ALTINTEGRATION_ADDVTB_HPP
7#define ALTINTEGRATION_ADDVTB_HPP
9#include <veriblock/pop/blockchain/alt_block_tree.hpp>
10#include <veriblock/pop/entities/vtb.hpp>
11#include <veriblock/pop/fmt.hpp>
16struct AddVTB :
public Command {
17 using block_t = VbkBlock;
18 ~AddVTB()
override =
default;
20 template <
class VTB_t>
21 AddVTB(AltBlockTree& tree, VTB_t&& vtb)
22 : tree_(tree), vtb_(std::forward<VTB_t>(vtb)) {}
24 bool Execute(ValidationState& state)
noexcept override {
26 return tree_.vbk().addPayloads(
27 vtb_.containingBlock.getHash(), {vtb_}, state);
30 void UnExecute() noexcept
override {
31 return tree_.vbk().unsafelyRemovePayload(vtb_.containingBlock.getHash(),