veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::AltBlockTree::BlockPayloadMutator Struct Reference

an incremental block builder More...

Detailed Description

Invariant
the tree must not be modified during the lifetime of the object

Definition at line 248 of file alt_block_tree.hpp.

#include <alt_block_tree.hpp>

+ Collaboration diagram for altintegration::AltBlockTree::BlockPayloadMutator:

Public Types

using tree_t = AltBlockTree
 
using block_index_t = typename tree_t::index_t
 
using id_vector_t = std::vector< uint8_t >
 

Public Member Functions

 BlockPayloadMutator (tree_t &tree, block_index_t &block, PayloadsIndex< block_index_t > &pl, FinalizedPayloadsIndex< block_index_t > &fpl)
 
bool isStatefulDuplicate (const id_vector_t &payload_id)
 stateful duplicate payload check as performed by connectBlock()
 
bool isStatelessDuplicate (const id_vector_t &payload_id)
 stateless payload duplicate check functionally equivalent to checkPopDataForDuplicates
 
template<typename Payload >
bool add (const Payload &payload, ValidationState &state)
 Add a payload to a leaf connected block, apply the payload if the block is applied. More...
 
block_index_t & getBlock ()
 

Member Typedef Documentation

◆ block_index_t

using altintegration::AltBlockTree::BlockPayloadMutator::block_index_t = typename tree_t::index_t

Definition at line 250 of file alt_block_tree.hpp.

◆ id_vector_t

using altintegration::AltBlockTree::BlockPayloadMutator::id_vector_t = std::vector<uint8_t>

Definition at line 251 of file alt_block_tree.hpp.

◆ tree_t

Member Function Documentation

◆ add()

template<typename Payload >
bool altintegration::AltBlockTree::BlockPayloadMutator::add ( const Payload &  payload,
ValidationState state 
)
Precondition
: the payload must be retrievable via getPayloadsProvider()
Invariant
: does not change the validity of any block
atomic: either adds and applies the payload or returns false and leaves the tree unchanged

◆ getBlock()

block_index_t & altintegration::AltBlockTree::BlockPayloadMutator::getBlock ( )
inline

Definition at line 275 of file alt_block_tree.hpp.

275{ return block_; }

The documentation for this struct was generated from the following file: