Kagome
Polkadot Runtime Engine in C++17
get_storage_size.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_STORAGE_SIZE
7 #define KAGOME_CORE_API_SERVICE_CHILD_STATE_REQUESTS_GET_STORAGE_SIZE
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 GetStorageSize final {
21  public:
22  GetStorageSize(GetStorageSize const &) = delete;
23  GetStorageSize &operator=(GetStorageSize const &) = delete;
24 
25  GetStorageSize(GetStorageSize &&) = default;
27 
28  explicit GetStorageSize(std::shared_ptr<ChildStateApi> api)
29  : api_(std::move(api)){};
30  ~GetStorageSize() = default;
31 
32  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
33 
34  outcome::result<std::optional<uint64_t>> 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_SIZE
Class represents arbitrary (including empty) byte buffer.
Definition: buffer.hpp:29
GetStorageSize(std::shared_ptr< ChildStateApi > api)
STL namespace.
GetStorageSize(GetStorageSize const &)=delete
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
outcome::result< std::optional< uint64_t > > execute()
std::optional< kagome::primitives::BlockHash > at_
GetStorageSize & operator=(GetStorageSize const &)=delete