mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
add state_getKeysPaged (#4718)
* add storage_getNextKey * RPC storage_getKeysPages * respect count * use iterator * improve * add tests * improve * add doc comments * Make prefix optional * update error * improve
This commit is contained in:
@@ -41,6 +41,14 @@ pub enum Error {
|
||||
/// Details of the error message.
|
||||
details: String,
|
||||
},
|
||||
/// Provided count exceeds maximum value.
|
||||
#[display(fmt = "count exceeds maximum value. value: {}, max: {}", value, max)]
|
||||
InvalidCount {
|
||||
/// Provided value
|
||||
value: u32,
|
||||
/// Maximum allowed value
|
||||
max: u32,
|
||||
},
|
||||
}
|
||||
|
||||
impl std::error::Error for Error {
|
||||
@@ -63,6 +71,11 @@ impl From<Error> for rpc::Error {
|
||||
message: format!("{}", e),
|
||||
data: None,
|
||||
},
|
||||
Error::InvalidCount { .. } => rpc::Error {
|
||||
code: rpc::ErrorCode::ServerError(BASE_ERROR + 2),
|
||||
message: format!("{}", e),
|
||||
data: None,
|
||||
},
|
||||
e => errors::internal(e),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user