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