mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 01:47:55 +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:
@@ -39,10 +39,23 @@ pub trait StateApi<Hash> {
|
||||
#[rpc(name = "state_call", alias("state_callAt"))]
|
||||
fn call(&self, name: String, bytes: Bytes, hash: Option<Hash>) -> FutureResult<Bytes>;
|
||||
|
||||
/// Returns the keys with prefix, leave empty to get all the keys
|
||||
/// DEPRECATED: Please use `state_getKeysPaged` with proper paging support.
|
||||
/// Returns the keys with prefix, leave empty to get all the keys.
|
||||
#[rpc(name = "state_getKeys")]
|
||||
fn storage_keys(&self, prefix: StorageKey, hash: Option<Hash>) -> FutureResult<Vec<StorageKey>>;
|
||||
|
||||
/// Returns the keys with prefix with pagination support.
|
||||
/// Up to `count` keys will be returned.
|
||||
/// If `start_key` is passed, return next keys in storage in lexicographic order.
|
||||
#[rpc(name = "state_getKeysPaged", alias("state_getKeysPagedAt"))]
|
||||
fn storage_keys_paged(
|
||||
&self,
|
||||
prefix: Option<StorageKey>,
|
||||
count: u32,
|
||||
start_key: Option<StorageKey>,
|
||||
hash: Option<Hash>,
|
||||
) -> FutureResult<Vec<StorageKey>>;
|
||||
|
||||
/// Returns a storage entry at a specific block's state.
|
||||
#[rpc(name = "state_getStorage", alias("state_getStorageAt"))]
|
||||
fn storage(&self, key: StorageKey, hash: Option<Hash>) -> FutureResult<Option<StorageData>>;
|
||||
|
||||
Reference in New Issue
Block a user