Kagome
Polkadot Runtime Engine in C++17
get_keys.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_KEYS_HPP
7 #define KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_KEYS_HPP
8 
9 #include <optional>
10 
11 #include <jsonrpc-lean/request.h>
12 
14 #include "outcome/outcome.hpp"
15 
17 
22  class GetKeys final {
23  public:
24  GetKeys(GetKeys const &) = delete;
25  GetKeys &operator=(GetKeys const &) = delete;
26 
27  GetKeys(GetKeys &&) = default;
28  GetKeys &operator=(GetKeys &&) = default;
29 
30  explicit GetKeys(std::shared_ptr<ChildStateApi> api)
31  : api_(std::move(api)) {
32  BOOST_ASSERT(api_);
33  };
34  ~GetKeys() = default;
35 
36  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
37 
38  outcome::result<std::vector<common::Buffer>> execute();
39 
40  private:
41  std::shared_ptr<ChildStateApi> api_;
43  std::optional<common::Buffer> prefix_;
44  std::optional<primitives::BlockHash> at_;
45  };
46 
47 } // namespace kagome::api::child_state::request
48 
49 #endif // KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_KEYS_HPP
Class represents arbitrary (including empty) byte buffer.
Definition: buffer.hpp:29
std::shared_ptr< ChildStateApi > api_
Definition: get_keys.hpp:41
STL namespace.
std::optional< common::Buffer > prefix_
Definition: get_keys.hpp:43
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: get_keys.cpp:12
GetKeys & operator=(GetKeys const &)=delete
std::optional< primitives::BlockHash > at_
Definition: get_keys.hpp:44
GetKeys(std::shared_ptr< ChildStateApi > api)
Definition: get_keys.hpp:30
outcome::result< std::vector< common::Buffer > > execute()
Definition: get_keys.cpp:64