Adds state_queryStorageAt (#5362)

* adds state_queryStorageAt

* make at param for query_storage_at optional

* Update client/rpc/src/state/state_full.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* adds query_storage_at to StateBackend

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Seun Lanlege
2020-03-26 16:03:34 +01:00
committed by GitHub
parent 970c5f94f2
commit ab0f7d213a
5 changed files with 88 additions and 10 deletions
+15
View File
@@ -163,6 +163,13 @@ pub trait StateBackend<Block: BlockT, Client>: Send + Sync + 'static
keys: Vec<StorageKey>,
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>;
/// Query storage entries (by key) starting at block hash given as the second parameter.
fn query_storage_at(
&self,
keys: Vec<StorageKey>,
at: Option<Block::Hash>
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>;
/// New runtime version subscription
fn subscribe_runtime_version(
&self,
@@ -357,6 +364,14 @@ impl<Block, Client> StateApi<Block::Hash> for State<Block, Client>
self.backend.query_storage(from, to, keys)
}
fn query_storage_at(
&self,
keys: Vec<StorageKey>,
at: Option<Block::Hash>
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>> {
self.backend.query_storage_at(keys, at)
}
fn subscribe_storage(
&self,
meta: Self::Metadata,