Kagome
Polkadot Runtime Engine in C++17
get_keys_paged.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_KEYS_PAGED_HPP
7 #define KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_KEYS_PAGED_HPP
8 
9 #include <optional>
10 
11 #include <jsonrpc-lean/request.h>
12 
14 #include "outcome/outcome.hpp"
15 
17 
22  class GetKeysPaged final {
23  public:
24  GetKeysPaged(GetKeysPaged const &) = delete;
25  GetKeysPaged &operator=(GetKeysPaged const &) = delete;
26 
27  GetKeysPaged(GetKeysPaged &&) = default;
28  GetKeysPaged &operator=(GetKeysPaged &&) = default;
29 
30  explicit GetKeysPaged(std::shared_ptr<ChildStateApi> api)
31  : api_(std::move(api)) {
32  BOOST_ASSERT(api_);
33  };
34  ~GetKeysPaged() = 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  uint32_t keys_amount_{};
45  std::optional<common::Buffer> prev_key_;
46  std::optional<primitives::BlockHash> at_;
47  };
48 
49 } // namespace kagome::api::child_state::request
50 
51 #endif // KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_KEYS_PAGED_HPP
Class represents arbitrary (including empty) byte buffer.
Definition: buffer.hpp:29
STL namespace.
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
GetKeysPaged(std::shared_ptr< ChildStateApi > api)
std::optional< common::Buffer > prev_key_
outcome::result< std::vector< common::Buffer > > execute()
std::optional< primitives::BlockHash > at_
GetKeysPaged(GetKeysPaged const &)=delete
GetKeysPaged & operator=(GetKeysPaged const &)=delete