Kagome
Polkadot Runtime Engine in C++17
chain_type.cpp
Go to the documentation of this file.
1 
7 
8 #include <boost/assert.hpp>
9 
11 
13 
14  ChainType::ChainType(std::shared_ptr<SystemApi> api) : api_(std::move(api)) {
15  BOOST_ASSERT(api_ != nullptr);
16  }
17 
18  outcome::result<void> ChainType::init(
19  const jsonrpc::Request::Parameters &params) {
20  if (!params.empty()) {
21  throw jsonrpc::InvalidParametersFault("Method should not have params");
22  }
23  return outcome::success();
24  }
25 
26  outcome::result<std::string> ChainType::execute() {
27  return api_->getConfig()->chainType();
28  }
29 
30 } // namespace kagome::api::system::request
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: chain_type.cpp:18
std::shared_ptr< SystemApi > api_
Definition: chain_type.hpp:38
STL namespace.
ChainType(const ChainType &)=delete
outcome::result< std::string > execute()
Definition: chain_type.cpp:26