Kagome
Polkadot Runtime Engine in C++17
version.cpp
Go to the documentation of this file.
1 
7 
8 #include <boost/assert.hpp>
9 
11 
13 
14  Version::Version(std::shared_ptr<SystemApi> api) : api_(std::move(api)) {
15  BOOST_ASSERT(api_ != nullptr);
16  }
17 
18  outcome::result<void> Version::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> Version::execute() {
27  return buildVersion();
28  }
29 
30 } // namespace kagome::api::system::request
Version(const Version &)=delete
STL namespace.
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: version.cpp:18
const std::string & buildVersion()
outcome::result< std::string > execute()
Definition: version.cpp:26
std::shared_ptr< SystemApi > api_
Definition: version.hpp:39