mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-08 17:07:21 +00:00
Add ability to iterate over N map storage keys (#537)
* Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update artifacts Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Change CLI default to bytes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Storage query example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update storage_query example with different alternatives Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * rpc: Make calls with StorageKey instead of the prefix Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Examples: Add double map storage iteration Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Use tracing_subscriber for logs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
+2
-4
@@ -28,7 +28,6 @@ use std::{
|
||||
|
||||
use crate::{
|
||||
error::BasicError,
|
||||
storage::StorageKeyPrefix,
|
||||
Config,
|
||||
Metadata,
|
||||
PhantomDataSendSync,
|
||||
@@ -277,13 +276,12 @@ impl<T: Config> Rpc<T> {
|
||||
/// If `start_key` is passed, return next keys in storage in lexicographic order.
|
||||
pub async fn storage_keys_paged(
|
||||
&self,
|
||||
prefix: Option<StorageKeyPrefix>,
|
||||
key: Option<StorageKey>,
|
||||
count: u32,
|
||||
start_key: Option<StorageKey>,
|
||||
hash: Option<T::Hash>,
|
||||
) -> Result<Vec<StorageKey>, BasicError> {
|
||||
let prefix = prefix.map(|p| p.to_storage_key());
|
||||
let params = rpc_params![prefix, count, start_key, hash];
|
||||
let params = rpc_params![key, count, start_key, hash];
|
||||
let data = self.client.request("state_getKeysPaged", params).await?;
|
||||
Ok(data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user