Kagome
Polkadot Runtime Engine in C++17
name.cpp
Go to the documentation of this file.
1 
7 
8 #include <boost/assert.hpp>
9 
11 
12  Name::Name(std::shared_ptr<SystemApi> api) : api_(std::move(api)) {
13  BOOST_ASSERT(api_ != nullptr);
14  }
15 
16  outcome::result<void> Name::init(const jsonrpc::Request::Parameters &params) {
17  if (!params.empty()) {
18  throw jsonrpc::InvalidParametersFault("Method should not have params");
19  }
20  return outcome::success();
21  }
22 
23  outcome::result<std::string> Name::execute() {
24  // In Polkadot it is just hardcoded string of client's implementation name:
25  // https://github.com/paritytech/polkadot/blob/c68aee352b84321b6a5691d38e20550577d60a45/cli/src/command.rs#L34
26  // So I assume we can safely use our client's name ehre
27  return "Soramitsu Kagome";
28  }
29 
30 } // namespace kagome::api::system::request
STL namespace.
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: name.cpp:16
std::shared_ptr< SystemApi > api_
Definition: name.hpp:39
outcome::result< std::string > execute()
Definition: name.cpp:23