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_STATE_REQUESTS_GET_KEYS_PAGED_HPP
7 #define KAGOME_CORE_API_SERVICE_STATE_REQUESTS_GET_KEYS_PAGED_HPP
8 
9 #include <jsonrpc-lean/request.h>
10 
11 #include <optional>
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<StateApi> 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<StateApi> api_;
42  std::optional<common::Buffer> prefix_;
43  uint32_t keys_amount_{};
44  std::optional<common::Buffer> prev_key_;
45  std::optional<primitives::BlockHash> at_;
46  };
47 
48 } // namespace kagome::api::state::request
49 
50 #endif // KAGOME_CORE_API_SERVICE_STATE_REQUESTS_GET_KEYS_PAGED_HPP
outcome::result< std::vector< common::Buffer > > execute()
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
GetKeysPaged(std::shared_ptr< StateApi > api)
std::optional< primitives::BlockHash > at_
STL namespace.
std::optional< common::Buffer > prev_key_
GetKeysPaged & operator=(GetKeysPaged const &)=delete
std::optional< common::Buffer > prefix_
GetKeysPaged(GetKeysPaged const &)=delete