Kagome
Polkadot Runtime Engine in C++17
subscribe_storage.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_API_REQUEST_SUBSCRIBE_STORAGE
7 #define KAGOME_API_REQUEST_SUBSCRIBE_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 SubscribeStorage final {
21  public:
22  SubscribeStorage(const SubscribeStorage &) = delete;
23  SubscribeStorage &operator=(const SubscribeStorage &) = delete;
24 
25  SubscribeStorage(SubscribeStorage &&) = default;
27 
28  explicit SubscribeStorage(std::shared_ptr<StateApi> api)
29  : api_(std::move(api)){};
30  ~SubscribeStorage() = default;
31 
32  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
33  outcome::result<uint32_t> execute();
34 
35  private:
36  std::shared_ptr<StateApi> api_;
37  std::vector<common::Buffer> key_buffers_;
38  };
39 
40 } // namespace kagome::api::state::request
41 
42 #endif // KAGOME_API_REQUEST_SUBSCRIBE_STORAGE
SubscribeStorage(std::shared_ptr< StateApi > api)
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
STL namespace.
SubscribeStorage & operator=(const SubscribeStorage &)=delete
SubscribeStorage(const SubscribeStorage &)=delete