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