Kagome
Polkadot Runtime Engine in C++17
grandpa_api.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_IMPL_GRANDPAAPI
7 #define KAGOME_RUNTIME_IMPL_GRANDPAAPI
8 
10 
12 
13 namespace kagome::runtime {
14 
15  class Executor;
16 
17  class GrandpaApiImpl final : public GrandpaApi {
18  public:
20  std::shared_ptr<blockchain::BlockHeaderRepository> block_header_repo,
21  std::shared_ptr<Executor> executor);
22 
23  outcome::result<std::optional<ScheduledChange>> pending_change(
24  primitives::BlockHash const &block, const Digest &digest) override;
25 
26  outcome::result<std::optional<ForcedChange>> forced_change(
27  primitives::BlockHash const &block, const Digest &digest) override;
28 
29  outcome::result<AuthorityList> authorities(
30  const primitives::BlockId &block_id) override;
31 
32  outcome::result<primitives::AuthoritySetId> current_set_id(
33  const primitives::BlockHash &block) override;
34 
35  private:
36  std::shared_ptr<blockchain::BlockHeaderRepository> block_header_repo_;
37  std::shared_ptr<Executor> executor_;
38  };
39 
40 } // namespace kagome::runtime
41 
42 #endif // KAGOME_RUNTIME_GRANDPAAPI
GrandpaApiImpl(std::shared_ptr< blockchain::BlockHeaderRepository > block_header_repo, std::shared_ptr< Executor > executor)
Definition: grandpa_api.cpp:12
std::shared_ptr< Executor > executor_
Definition: grandpa_api.hpp:37
outcome::result< AuthorityList > authorities(const primitives::BlockId &block_id) override
calls Grandpa_authorities runtime api function
Definition: grandpa_api.cpp:35
outcome::result< primitives::AuthoritySetId > current_set_id(const primitives::BlockHash &block) override
Definition: grandpa_api.cpp:42
interface for Grandpa runtime functions
Definition: grandpa_api.hpp:26
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...
Definition: grandpa_api.cpp:22
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 ...
Definition: grandpa_api.cpp:29
std::shared_ptr< blockchain::BlockHeaderRepository > block_header_repo_
Definition: grandpa_api.hpp:36
boost::variant< BlockHash, BlockNumber > BlockId
Block id is the variant over BlockHash and BlockNumber.
Definition: block_id.hpp:18