Paged keys rpc for child storage. (#9100)

* childstate_getKeysPaged rpc

* Rename `v` to `iter`.

* Update client/api/src/backend.rs

Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>

* Update client/api/src/backend.rs

Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>

Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>
This commit is contained in:
cheme
2021-07-07 09:22:13 +02:00
committed by GitHub
parent fc1199b6a1
commit d80e1bc978
7 changed files with 151 additions and 9 deletions
+21
View File
@@ -402,6 +402,16 @@ pub trait ChildStateBackend<Block: BlockT, Client>: Send + Sync + 'static
prefix: StorageKey,
) -> FutureResult<Vec<StorageKey>>;
/// Returns the keys with prefix from a child storage with pagination support.
fn storage_keys_paged(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
) -> FutureResult<Vec<StorageKey>>;
/// Returns a child storage entry at a specific block's state.
fn storage(
&self,
@@ -469,6 +479,17 @@ impl<Block, Client> ChildStateApi<Block::Hash> for ChildState<Block, Client>
self.backend.storage_keys(block, storage_key, key_prefix)
}
fn storage_keys_paged(
&self,
storage_key: PrefixedStorageKey,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
block: Option<Block::Hash>,
) -> FutureResult<Vec<StorageKey>> {
self.backend.storage_keys_paged(block, storage_key, prefix, count, start_key)
}
fn storage_hash(
&self,
storage_key: PrefixedStorageKey,