Kagome
Polkadot Runtime Engine in C++17
kagome::consensus::BlockAppenderImpl Class Reference

#include <block_appender_impl.hpp>

Inheritance diagram for kagome::consensus::BlockAppenderImpl:
Collaboration diagram for kagome::consensus::BlockAppenderImpl:

Public Types

enum  Error { Error::INVALID_BLOCK = 1, Error::PARENT_NOT_FOUND }
 

Public Member Functions

 BlockAppenderImpl (std::shared_ptr< blockchain::BlockTree > block_tree, std::shared_ptr< consensus::babe::BabeConfigRepository > babe_config_repo, std::shared_ptr< BlockValidator > block_validator, std::shared_ptr< grandpa::Environment > grandpa_environment, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< blockchain::DigestTracker > digest_tracker, std::shared_ptr< BabeUtil > babe_util, std::shared_ptr< babe::ConsistencyKeeper > consistency_keeper)
 
outcome::result< void > appendBlock (primitives::BlockData &&b) override
 
outcome::result< void > applyJustification (const primitives::BlockInfo &block_info, const primitives::Justification &justification) override
 
- Public Member Functions inherited from kagome::consensus::BlockAppender
virtual ~BlockAppender ()=default
 

Private Attributes

std::shared_ptr< blockchain::BlockTreeblock_tree_
 
std::shared_ptr< consensus::babe::BabeConfigRepositorybabe_config_repo_
 
std::shared_ptr< BlockValidatorblock_validator_
 
std::shared_ptr< grandpa::Environmentgrandpa_environment_
 
std::shared_ptr< crypto::Hasherhasher_
 
std::shared_ptr< blockchain::DigestTrackerdigest_tracker_
 
std::shared_ptr< BabeUtilbabe_util_
 
std::shared_ptr< babe::ConsistencyKeeperconsistency_keeper_
 
std::optional< primitives::BlockInfolast_appended_
 
std::map< primitives::BlockInfo, primitives::Justificationjustifications_
 
struct {
std::chrono::high_resolution_clock::time_point time
 
primitives::BlockNumber block_number
 
speed_data_ = {}
 
log::Logger logger_
 

Detailed Description

Definition at line 34 of file block_appender_impl.hpp.

Member Enumeration Documentation

Enumerator
INVALID_BLOCK 
PARENT_NOT_FOUND 

Definition at line 38 of file block_appender_impl.hpp.

Constructor & Destructor Documentation

kagome::consensus::BlockAppenderImpl::BlockAppenderImpl ( std::shared_ptr< blockchain::BlockTree block_tree,
std::shared_ptr< consensus::babe::BabeConfigRepository babe_config_repo,
std::shared_ptr< BlockValidator block_validator,
std::shared_ptr< grandpa::Environment grandpa_environment,
std::shared_ptr< crypto::Hasher hasher,
std::shared_ptr< blockchain::DigestTracker digest_tracker,
std::shared_ptr< BabeUtil babe_util,
std::shared_ptr< babe::ConsistencyKeeper consistency_keeper 
)

Definition at line 35 of file block_appender_impl.cpp.

Member Function Documentation

outcome::result< void > kagome::consensus::BlockAppenderImpl::appendBlock ( primitives::BlockData &&  b)
overridevirtual

Implements kagome::consensus::BlockAppender.

Definition at line 64 of file block_appender_impl.cpp.

outcome::result< void > kagome::consensus::BlockAppenderImpl::applyJustification ( const primitives::BlockInfo block_info,
const primitives::Justification justification 
)
overridevirtual

Implements kagome::consensus::BlockAppender.

Definition at line 276 of file block_appender_impl.cpp.

Member Data Documentation

std::shared_ptr<consensus::babe::BabeConfigRepository> kagome::consensus::BlockAppenderImpl::babe_config_repo_
private

Definition at line 58 of file block_appender_impl.hpp.

std::shared_ptr<BabeUtil> kagome::consensus::BlockAppenderImpl::babe_util_
private

Definition at line 63 of file block_appender_impl.hpp.

std::shared_ptr<blockchain::BlockTree> kagome::consensus::BlockAppenderImpl::block_tree_
private

Definition at line 57 of file block_appender_impl.hpp.

std::shared_ptr<BlockValidator> kagome::consensus::BlockAppenderImpl::block_validator_
private

Definition at line 59 of file block_appender_impl.hpp.

std::shared_ptr<babe::ConsistencyKeeper> kagome::consensus::BlockAppenderImpl::consistency_keeper_
private

Definition at line 64 of file block_appender_impl.hpp.

std::shared_ptr<blockchain::DigestTracker> kagome::consensus::BlockAppenderImpl::digest_tracker_
private

Definition at line 62 of file block_appender_impl.hpp.

std::shared_ptr<grandpa::Environment> kagome::consensus::BlockAppenderImpl::grandpa_environment_
private

Definition at line 60 of file block_appender_impl.hpp.

std::shared_ptr<crypto::Hasher> kagome::consensus::BlockAppenderImpl::hasher_
private

Definition at line 61 of file block_appender_impl.hpp.

std::map<primitives::BlockInfo, primitives::Justification> kagome::consensus::BlockAppenderImpl::justifications_
private

Definition at line 69 of file block_appender_impl.hpp.

std::optional<primitives::BlockInfo> kagome::consensus::BlockAppenderImpl::last_appended_
private

Definition at line 66 of file block_appender_impl.hpp.

log::Logger kagome::consensus::BlockAppenderImpl::logger_
private

Definition at line 76 of file block_appender_impl.hpp.

struct { ... } kagome::consensus::BlockAppenderImpl::speed_data_

The documentation for this class was generated from the following files: