Kagome
Polkadot Runtime Engine in C++17
get_storage.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_STORAGE
7 #define KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_STORAGE
8 
9 #include <optional>
10 
11 #include <jsonrpc-lean/request.h>
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<ChildStateApi> api)
29  : api_(std::move(api)){};
30  ~GetStorage() = default;
31 
32  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
33 
34  outcome::result<std::optional<common::Buffer>> execute();
35 
36  private:
37  std::shared_ptr<ChildStateApi> api_;
40  std::optional<kagome::primitives::BlockHash> at_;
41  };
42 
43 } // namespace kagome::api::child_state::request
44 
45 #endif // KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_STORAGE
Class represents arbitrary (including empty) byte buffer.
Definition: buffer.hpp:29
STL namespace.
GetStorage & operator=(GetStorage const &)=delete
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: get_storage.cpp:10
outcome::result< std::optional< common::Buffer > > execute()
Definition: get_storage.cpp:54
std::shared_ptr< ChildStateApi > api_
Definition: get_storage.hpp:37
GetStorage(std::shared_ptr< ChildStateApi > api)
Definition: get_storage.hpp:28
std::optional< kagome::primitives::BlockHash > at_
Definition: get_storage.hpp:40