mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 02:57:57 +00:00
Add block-centric Storage API (#774)
* blocks: Add storage method Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add support for runtime API calls and expose it to the blocks API Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * storage: Add storage type for block centric API Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Adjust subxt to the new Storage interface Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -126,7 +126,10 @@ async fn fetch_keys() {
|
||||
let addr = node_runtime::storage().system().account_root();
|
||||
let keys = api
|
||||
.storage()
|
||||
.fetch_keys(&addr.to_root_bytes(), 4, None, None)
|
||||
.at(None)
|
||||
.await
|
||||
.unwrap()
|
||||
.fetch_keys(&addr.to_root_bytes(), 4, None)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(keys.len(), 4)
|
||||
@@ -138,7 +141,14 @@ async fn test_iter() {
|
||||
let api = ctx.client();
|
||||
|
||||
let addr = node_runtime::storage().system().account_root();
|
||||
let mut iter = api.storage().iter(addr, 10, None).await.unwrap();
|
||||
let mut iter = api
|
||||
.storage()
|
||||
.at(None)
|
||||
.await
|
||||
.unwrap()
|
||||
.iter(addr, 10)
|
||||
.await
|
||||
.unwrap();
|
||||
let mut i = 0;
|
||||
while iter.next().await.unwrap().is_some() {
|
||||
i += 1;
|
||||
|
||||
Reference in New Issue
Block a user