Kagome
Polkadot Runtime Engine in C++17
session_keys_api.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_RUNTIME_SESSIONKEYSAPI
7 #define KAGOME_RUNTIME_SESSIONKEYSAPI
8 
9 #include <optional>
10 
11 #include <outcome/outcome.hpp>
12 
14 #include "primitives/common.hpp"
16 
17 namespace kagome::runtime {
18 
20  public:
21  virtual ~SessionKeysApi() = default;
22 
30  virtual outcome::result<common::Buffer> generate_session_keys(
31  const primitives::BlockHash &block_hash,
32  std::optional<common::Buffer> seed) = 0;
33 
38  virtual outcome::result<
39  std::vector<std::pair<crypto::KeyTypeId, common::Buffer>>>
41  common::BufferConstRef encoded) const = 0;
42  };
43 
44 } // namespace kagome::runtime
45 
46 #endif // KAGOME_RUNTIME_SESSIONKEYSAPI
virtual outcome::result< common::Buffer > generate_session_keys(const primitives::BlockHash &block_hash, std::optional< common::Buffer > seed)=0
Generate a set of session keys with optionally using the given seed. The keys should be stored within...
virtual outcome::result< std::vector< std::pair< crypto::KeyTypeId, common::Buffer > > > decode_session_keys(const primitives::BlockHash &block_hash, common::BufferConstRef encoded) const =0
Decode the given public session keys.
std::reference_wrapper< const Buffer > BufferConstRef
Definition: buffer.hpp:249
virtual ~SessionKeysApi()=default