veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
block_batch.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_BLOCK_BATCH_HPP
7#define VERIBLOCK_POP_CPP_BLOCK_BATCH_HPP
8
9#include <veriblock/pop/entities/altblock.hpp>
10#include <veriblock/pop/entities/btcblock.hpp>
11#include <veriblock/pop/entities/vbkblock.hpp>
12#include <veriblock/pop/storage/stored_block_index.hpp>
13
14namespace altintegration {
15
22struct BlockBatch {
23 virtual ~BlockBatch() = default;
24
31 virtual void writeBlock(const AltBlock::hash_t& hash,
32 const AltBlock::prev_hash_t& prev_hash,
33 const StoredBlockIndex<AltBlock>& value) = 0;
35 virtual void writeBlock(const VbkBlock::hash_t& hash,
36 const VbkBlock::prev_hash_t& prev_hash,
37 const StoredBlockIndex<VbkBlock>& value) = 0;
39 virtual void writeBlock(const BtcBlock::hash_t& hash,
40 const BtcBlock::prev_hash_t& prev_hash,
41 const StoredBlockIndex<BtcBlock>& value) = 0;
42
47 virtual void writeTip(const AltBlock::hash_t& value) = 0;
49 virtual void writeTip(const VbkBlock::hash_t& value) = 0;
51 virtual void writeTip(const BtcBlock::hash_t& value) = 0;
52};
53
54} // namespace altintegration
55
56#endif // VERIBLOCK_POP_CPP_BLOCK_BATCH_HPP
Defines logging helpers.
Definition: block.hpp:14
Contiguous byte array of fixed size.
Definition: blob.hpp:25
An interface which represents single write batch of a group of blocks.
Definition: block_batch.hpp:22
virtual void writeTip(const VbkBlock::hash_t &value)=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void writeTip(const BtcBlock::hash_t &value)=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void writeTip(const AltBlock::hash_t &value)=0
Save Tree tip on disk.
virtual void writeBlock(const BtcBlock::hash_t &hash, const BtcBlock::prev_hash_t &prev_hash, const StoredBlockIndex< BtcBlock > &value)=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void writeBlock(const VbkBlock::hash_t &hash, const VbkBlock::prev_hash_t &prev_hash, const StoredBlockIndex< VbkBlock > &value)=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void writeBlock(const AltBlock::hash_t &hash, const AltBlock::prev_hash_t &prev_hash, const StoredBlockIndex< AltBlock > &value)=0
Save BlockIndex on disk.