mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-01 16:31:07 +00:00
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:
1 parent
fc1199b6a1
commit
d80e1bc978
7 files changed
+151
-9
No files matched your search
@@ -1481,7 +1481,6 @@ impl<B, E, Block, RA> StorageProvider<Block, B> for Client<B, E, Block, RA> wher
|
||||
Ok(keys)
|
||||
}
|
||||
|
||||
|
||||
fn storage_keys_iter<'a>(
|
||||
&self,
|
||||
id: &BlockId<Block>,
|
||||
@@ -1496,6 +1495,20 @@ impl<B, E, Block, RA> StorageProvider<Block, B> for Client<B, E, Block, RA> wher
|
||||
Ok(KeyIterator::new(state, prefix, start_key))
|
||||
}
|
||||
|
||||
fn child_storage_keys_iter<'a>(
|
||||
&self,
|
||||
id: &BlockId<Block>,
|
||||
child_info: ChildInfo,
|
||||
prefix: Option<&'a StorageKey>,
|
||||
start_key: Option<&StorageKey>
|
||||
) -> sp_blockchain::Result<KeyIterator<'a, B::State, Block>> {
|
||||
let state = self.state_at(id)?;
|
||||
let start_key = start_key
|
||||
.or(prefix)
|
||||
.map(|key| key.0.clone())
|
||||
.unwrap_or_else(Vec::new);
|
||||
Ok(KeyIterator::new_child(state, child_info, prefix, start_key))
|
||||
}
|
||||
|
||||
fn storage(
|
||||
&self,
|
||||
|
||||
Reference in new issue
Block a user