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