Kagome
Polkadot Runtime Engine in C++17
get_block_hash.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_GET_BLOCK_HASH_HPP
7 #define KAGOME_GET_BLOCK_HASH_HPP
8 
9 #include <jsonrpc-lean/request.h>
10 
12 #include "primitives/extrinsic.hpp"
13 
15 
16  class GetBlockhash final {
17  struct NoParameters {};
19  using Param2 = std::string;
20  using VectorParam = boost::variant<Param1, Param2>;
21  using Param3 = std::vector<VectorParam>;
22  using Param = boost::variant<NoParameters, Param1, Param2, Param3>;
23 
24  public:
25  explicit GetBlockhash(std::shared_ptr<ChainApi> api)
26  : api_(std::move(api)){};
27 
28  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
29 
30  using ResultType = boost::variant<std::string, std::vector<std::string>>;
31  outcome::result<ResultType> execute();
32 
33  private:
34  std::shared_ptr<ChainApi> api_;
36  };
37 
38 } // namespace kagome::api::chain::request
39 #endif // KAGOME_GET_BLOCK_HASH_HPP
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
boost::variant< std::string, std::vector< std::string >> ResultType
STL namespace.
uint32_t BlockNumber
Definition: common.hpp:18
boost::variant< Param1, Param2 > VectorParam
outcome::result< ResultType > execute()
boost::variant< NoParameters, Param1, Param2, Param3 > Param
GetBlockhash(std::shared_ptr< ChainApi > api)