Kagome
Polkadot Runtime Engine in C++17
session_keys_api.cpp
Go to the documentation of this file.
1 
7 
9 
10 namespace kagome::runtime {
11 
12  SessionKeysApiImpl::SessionKeysApiImpl(std::shared_ptr<Executor> executor)
13  : executor_{std::move(executor)} {
14  BOOST_ASSERT(executor_);
15  }
16 
17  outcome::result<common::Buffer> SessionKeysApiImpl::generate_session_keys(
18  const primitives::BlockHash &block_hash,
19  std::optional<common::Buffer> seed) {
20  return executor_->callAt<common::Buffer, std::optional<common::Buffer>>(
21  block_hash, "SessionKeys_generate_session_keys", std::move(seed));
22  }
23 
24  outcome::result<std::vector<std::pair<crypto::KeyTypeId, common::Buffer>>>
26  const primitives::BlockHash &block_hash,
27  common::BufferConstRef encoded) const {
28  return executor_
29  ->callAt<std::vector<std::pair<crypto::KeyTypeId, common::Buffer>>>(
30  block_hash, "SessionKeys_decode_session_keys", encoded);
31  }
32 
33 } // namespace kagome::runtime
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.
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
Definition: buffer.hpp:244
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)