Kagome
Polkadot Runtime Engine in C++17
properties.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_API_SYSTEM_REQUEST_PROPERTIES
7 #define KAGOME_API_SYSTEM_REQUEST_PROPERTIES
8 
9 #include <jsonrpc-lean/request.h>
10 
11 #include "outcome/outcome.hpp"
12 
13 namespace kagome::api {
14  class SystemApi;
15 }
16 
18 
25  class Properties final {
26  public:
27  Properties(Properties const &) = delete;
28  Properties &operator=(Properties const &) = delete;
29 
30  Properties(Properties &&) = default;
31  Properties &operator=(Properties &&) = default;
32 
33  explicit Properties(std::shared_ptr<SystemApi> api)
34  : api_(std::move(api)){};
35  ~Properties() = default;
36 
37  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
38 
39  outcome::result<std::map<std::string, std::string>> execute();
40 
41  private:
42  std::shared_ptr<SystemApi> api_;
43  };
44 
45 } // namespace kagome::api::system::request
46 
47 #endif // KAGOME_API_SYSTEM_REQUEST_PROPERTIES
std::shared_ptr< SystemApi > api_
Definition: properties.hpp:42
Properties(std::shared_ptr< SystemApi > api)
Definition: properties.hpp:33
STL namespace.
Get a custom set of properties as a JSON object, defined in the chain spec.
Definition: properties.hpp:25
outcome::result< std::map< std::string, std::string > > execute()
Definition: properties.cpp:20
Properties & operator=(Properties const &)=delete
Properties(Properties const &)=delete
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: properties.cpp:12