Kagome
Polkadot Runtime Engine in C++17
kagome::runtime::GrandpaApi Class Referenceabstract

interface for Grandpa runtime functions More...

#include <grandpa_api.hpp>

Inheritance diagram for kagome::runtime::GrandpaApi:
Collaboration diagram for kagome::runtime::GrandpaApi:

Public Member Functions

virtual ~GrandpaApi ()=default
 
virtual outcome::result< std::optional< ScheduledChange > > pending_change (primitives::BlockHash const &block, const Digest &digest)=0
 calls Grandpa_pending_change runtime api function, which checks a digest for pending changes. More...
 
virtual outcome::result< std::optional< ForcedChange > > forced_change (primitives::BlockHash const &block, const Digest &digest)=0
 calls Grandpa_forced_change runtime api function which checks a digest for forced changes More...
 
virtual outcome::result< AuthorityListauthorities (const primitives::BlockId &block_id)=0
 calls Grandpa_authorities runtime api function More...
 
virtual outcome::result< primitives::AuthoritySetIdcurrent_set_id (const primitives::BlockHash &block)=0
 

Protected Types

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

interface for Grandpa runtime functions

Definition at line 26 of file grandpa_api.hpp.

Member Typedef Documentation

Definition at line 33 of file grandpa_api.hpp.

Definition at line 28 of file grandpa_api.hpp.

Constructor & Destructor Documentation

virtual kagome::runtime::GrandpaApi::~GrandpaApi ( )
virtualdefault

Member Function Documentation

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

calls Grandpa_authorities runtime api function

Returns
collection of current grandpa authorities with their weights

Implemented in kagome::runtime::GrandpaApiImpl.

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

Implemented in kagome::runtime::GrandpaApiImpl.

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

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

Implemented in kagome::runtime::GrandpaApiImpl.

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

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

Implemented in kagome::runtime::GrandpaApiImpl.


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