Kagome
Polkadot Runtime Engine in C++17
session_keys_api.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_SESSIONKEYSAPIIMPL
7 #define KAGOME_RUNTIME_SESSIONKEYSAPIIMPL
8 
10 
11 namespace kagome::runtime {
12 
13  class Executor;
14 
15  class SessionKeysApiImpl final : public SessionKeysApi {
16  public:
17  explicit SessionKeysApiImpl(std::shared_ptr<Executor> executor);
18 
19  outcome::result<common::Buffer> generate_session_keys(
20  const primitives::BlockHash &block_hash,
21  std::optional<common::Buffer> seed) override;
22 
23  outcome::result<std::vector<std::pair<crypto::KeyTypeId, common::Buffer>>>
25  common::BufferConstRef encoded) const override;
26 
27  private:
28  std::shared_ptr<Executor> executor_;
29  };
30 
31 } // namespace kagome::runtime
32 
33 #endif // KAGOME_RUNTIME_SESSIONKEYSAPIIMPL
std::shared_ptr< Executor > executor_
outcome::result< std::vector< std::pair< crypto::KeyTypeId, common::Buffer > > > decode_session_keys(const primitives::BlockHash &block_hash, common::BufferConstRef encoded) const override
Decode the given public session keys.
std::reference_wrapper< const Buffer > BufferConstRef
Definition: buffer.hpp:249
outcome::result< common::Buffer > generate_session_keys(const primitives::BlockHash &block_hash, std::optional< common::Buffer > seed) override
Generate a set of session keys with optionally using the given seed. The keys should be stored within...
SessionKeysApiImpl(std::shared_ptr< Executor > executor)