11 const jsonrpc::Request::Parameters ¶ms) {
12 if (params.size() > 3 or params.size() < 2) {
13 throw jsonrpc::InvalidParametersFault(
"Incorrect number of params");
15 auto ¶m0 = params[0];
17 if (not param0.IsString()) {
18 throw jsonrpc::InvalidParametersFault(
19 "Parameter '[child_storage_key]' must be a hex string");
25 auto ¶m1 = params[1];
26 if (not param1.IsString()) {
27 throw jsonrpc::InvalidParametersFault(
28 "Parameter 'key' must be a hex string");
30 auto &&key_str = param1.AsString();
35 if (params.size() == 3) {
36 auto ¶m2 = params[2];
37 if (param2.IsString()) {
38 auto &&at_str = param2.AsString();
42 }
else if (param2.IsNil()) {
45 throw jsonrpc::InvalidParametersFault(
46 "Parameter 'at' must be a hex string or null");
51 return outcome::success();
54 outcome::result<std::optional<primitives::BlockHash>>
outcome::result< std::vector< uint8_t > > unhexWith0x(std::string_view hex_with_prefix)
Unhex hex-string with 0x in the begining.
std::optional< kagome::primitives::BlockHash > at_
std::shared_ptr< ChildStateApi > api_
outcome::result< std::optional< kagome::primitives::BlockHash > > execute()
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
common::Buffer child_storage_key_
static outcome::result< Blob< size_ > > fromSpan(const gsl::span< const uint8_t > &span)
outcome::result< void > init(const jsonrpc::Request::Parameters ¶ms)