11 const jsonrpc::Request::Parameters ¶ms) {
12 if (params.size() > 2 or params.empty()) {
13 throw jsonrpc::InvalidParametersFault(
"Incorrect number of params");
15 auto ¶m0 = params[0];
16 if (not param0.IsString()) {
17 throw jsonrpc::InvalidParametersFault(
18 "Parameter 'key' must be a hex string");
20 auto &&key_str = param0.AsString();
25 if (params.size() > 1) {
26 auto ¶m1 = params[1];
27 if (param1.IsString()) {
28 auto &&at_str = param1.AsString();
32 }
else if (param1.IsNil()) {
35 throw jsonrpc::InvalidParametersFault(
36 "Parameter 'at' must be a hex string or null");
41 return outcome::success();
outcome::result< std::optional< common::Buffer > > execute()
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_
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
outcome::result< void > init(const jsonrpc::Request::Parameters ¶ms)
static outcome::result< Blob< size_ > > fromSpan(const gsl::span< const uint8_t > &span)
std::shared_ptr< StateApi > api_