Kagome
Polkadot Runtime Engine in C++17
unsubscribe_storage.cpp
Go to the documentation of this file.
1 
7 
9 
10  outcome::result<void> UnsubscribeStorage::init(
11  const jsonrpc::Request::Parameters &params) {
12  if (params.size() > 1 or params.empty()) {
13  throw jsonrpc::InvalidParametersFault("Incorrect number of params");
14  }
15 
16  auto &id = params[0];
17  if (!id.IsInteger32()) {
18  throw jsonrpc::InvalidParametersFault(
19  "Parameter 'params' must be an integer value of subscriber ID");
20  }
21 
22  subscriber_id_.emplace_back(id.AsInteger32());
23  return outcome::success();
24  }
25 
26  outcome::result<bool> UnsubscribeStorage::execute() {
27  return api_->unsubscribeStorage(subscriber_id_);
28  }
29 
30 } // namespace kagome::api::state::request
outcome::result< void > init(const jsonrpc::Request::Parameters &params)