Kagome
Polkadot Runtime Engine in C++17
kagome::runtime::GrandpaApiImpl Class Referencefinal

#include <grandpa_api.hpp>

Inheritance diagram for kagome::runtime::GrandpaApiImpl:
Collaboration diagram for kagome::runtime::GrandpaApiImpl:

Public Member Functions

 GrandpaApiImpl (std::shared_ptr< blockchain::BlockHeaderRepository > block_header_repo, std::shared_ptr< Executor > executor)
 
outcome::result< std::optional< ScheduledChange > > pending_change (primitives::BlockHash const &block, const Digest &digest) override
 calls Grandpa_pending_change runtime api function, which checks a digest for pending changes. More...
 
outcome::result< std::optional< ForcedChange > > forced_change (primitives::BlockHash const &block, const Digest &digest) override
 calls Grandpa_forced_change runtime api function which checks a digest for forced changes More...
 
outcome::result< AuthorityListauthorities (const primitives::BlockId &block_id) override
 calls Grandpa_authorities runtime api function More...
 
outcome::result< primitives::AuthoritySetIdcurrent_set_id (const primitives::BlockHash &block) override
 
- Public Member Functions inherited from kagome::runtime::GrandpaApi
virtual ~GrandpaApi ()=default
 

Private Attributes

std::shared_ptr< blockchain::BlockHeaderRepositoryblock_header_repo_
 
std::shared_ptr< Executorexecutor_
 

Additional Inherited Members

- Protected Types inherited from kagome::runtime::GrandpaApi
using Digest = primitives::Digest
 
using ScheduledChange = primitives::ScheduledChange
 
using BlockNumber = primitives::BlockNumber
 
using AuthorityList = primitives::AuthorityList
 
using ForcedChange = primitives::ForcedChange
 
using BlockId = primitives::BlockId
 

Detailed Description

Definition at line 17 of file grandpa_api.hpp.

Constructor & Destructor Documentation

kagome::runtime::GrandpaApiImpl::GrandpaApiImpl ( std::shared_ptr< blockchain::BlockHeaderRepository block_header_repo,
std::shared_ptr< Executor executor 
)

Definition at line 12 of file grandpa_api.cpp.

Member Function Documentation

outcome::result< GrandpaApi::AuthorityList > kagome::runtime::GrandpaApiImpl::authorities ( const primitives::BlockId block_id)
overridevirtual

calls Grandpa_authorities runtime api function

Returns
collection of current grandpa authorities with their weights

Implements kagome::runtime::GrandpaApi.

Definition at line 35 of file grandpa_api.cpp.

outcome::result< primitives::AuthoritySetId > kagome::runtime::GrandpaApiImpl::current_set_id ( const primitives::BlockHash block)
overridevirtual
Returns
the id of the current voter set at the provided block

Implements kagome::runtime::GrandpaApi.

Definition at line 42 of file grandpa_api.cpp.

outcome::result< std::optional< GrandpaApi::ForcedChange > > kagome::runtime::GrandpaApiImpl::forced_change ( primitives::BlockHash const &  block,
const Digest digest 
)
overridevirtual

calls Grandpa_forced_change runtime api function which checks a digest for forced changes

Parameters
digestdigest to check
Returns
nullopt if no forced changes, forced change item if exists or error if error occured

Implements kagome::runtime::GrandpaApi.

Definition at line 29 of file grandpa_api.cpp.

outcome::result< std::optional< GrandpaApi::ScheduledChange > > kagome::runtime::GrandpaApiImpl::pending_change ( primitives::BlockHash const &  block,
const Digest digest 
)
overridevirtual

calls Grandpa_pending_change runtime api function, which checks a digest for pending changes.

Parameters
digestdigest to check
Returns
nullopt if there are no pending changes, scheduled change item if exists or error if error occured

Implements kagome::runtime::GrandpaApi.

Definition at line 22 of file grandpa_api.cpp.

Member Data Documentation

std::shared_ptr<blockchain::BlockHeaderRepository> kagome::runtime::GrandpaApiImpl::block_header_repo_
private

Definition at line 36 of file grandpa_api.hpp.

std::shared_ptr<Executor> kagome::runtime::GrandpaApiImpl::executor_
private

Definition at line 37 of file grandpa_api.hpp.


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