Kagome
Polkadot Runtime Engine in C++17
chain_type.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_API_SERVICE_SYSTEM_REQUESTS_CHAIN_TYPE_HPP
7 #define KAGOME_CORE_API_SERVICE_SYSTEM_REQUESTS_CHAIN_TYPE_HPP
8 
9 #include <jsonrpc-lean/request.h>
10 
11 #include "outcome/outcome.hpp"
12 
13 namespace kagome::api {
14  class SystemApi;
15 }
16 
18 
22  class ChainType final {
23  public:
24  ChainType(const ChainType &) = delete;
25  ChainType &operator=(const ChainType &) = delete;
26 
27  ChainType(ChainType &&) = default;
28  ChainType &operator=(ChainType &&) = default;
29 
30  explicit ChainType(std::shared_ptr<SystemApi> api);
31  ~ChainType() = default;
32 
33  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
34 
35  outcome::result<std::string> execute();
36 
37  private:
38  std::shared_ptr<SystemApi> api_;
39  };
40 
41 } // namespace kagome::api::system::request
42 
43 #endif // KAGOME_CORE_API_SERVICE_SYSTEM_REQUESTS_CHAIN_TYPE_HPP
Get the chain&#39;s type. Given as a string identifier.
Definition: chain_type.hpp:22
ChainType & operator=(const ChainType &)=delete
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: chain_type.cpp:18
std::shared_ptr< SystemApi > api_
Definition: chain_type.hpp:38
ChainType(const ChainType &)=delete
outcome::result< std::string > execute()
Definition: chain_type.cpp:26