Skip to content
Snippets Groups Projects
Commit 699cc55d authored by Michal Kucharczyk's avatar Michal Kucharczyk Committed by GitHub
Browse files

BlockId removal: refactor: StorageProvider (#6160)


* BlockId removal: refactor: StorageProvider

It changes the arguments of `Backend::StorageProvider` trait from:
block: `BlockId<Block>` to: hash: `&Block::Hash`

* Update node/client/src/lib.rs

Co-authored-by: default avatarBastian Köcher <info@kchr.de>

* update lockfile for {"substrate"}

Co-authored-by: default avatarBastian Köcher <info@kchr.de>
Co-authored-by: parity-processbot <>
parent befaec4c
Branches
No related merge requests found
This diff is collapsed.
......@@ -421,63 +421,63 @@ impl sc_client_api::BlockBackend<Block> for Client {
impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
fn storage(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
key: &StorageKey,
) -> sp_blockchain::Result<Option<StorageData>> {
with_client! {
self,
client,
{
client.storage(id, key)
client.storage(hash, key)
}
}
}
fn storage_keys(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
key_prefix: &StorageKey,
) -> sp_blockchain::Result<Vec<StorageKey>> {
with_client! {
self,
client,
{
client.storage_keys(id, key_prefix)
client.storage_keys(hash, key_prefix)
}
}
}
fn storage_hash(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
key: &StorageKey,
) -> sp_blockchain::Result<Option<<Block as BlockT>::Hash>> {
with_client! {
self,
client,
{
client.storage_hash(id, key)
client.storage_hash(hash, key)
}
}
}
fn storage_pairs(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
key_prefix: &StorageKey,
) -> sp_blockchain::Result<Vec<(StorageKey, StorageData)>> {
with_client! {
self,
client,
{
client.storage_pairs(id, key_prefix)
client.storage_pairs(hash, key_prefix)
}
}
}
fn storage_keys_iter<'a>(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
......@@ -487,14 +487,14 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
self,
client,
{
client.storage_keys_iter(id, prefix, start_key)
client.storage_keys_iter(hash, prefix, start_key)
}
}
}
fn child_storage(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
child_info: &ChildInfo,
key: &StorageKey,
) -> sp_blockchain::Result<Option<StorageData>> {
......@@ -502,14 +502,14 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
self,
client,
{
client.child_storage(id, child_info, key)
client.child_storage(hash, child_info, key)
}
}
}
fn child_storage_keys(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
child_info: &ChildInfo,
key_prefix: &StorageKey,
) -> sp_blockchain::Result<Vec<StorageKey>> {
......@@ -517,14 +517,14 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
self,
client,
{
client.child_storage_keys(id, child_info, key_prefix)
client.child_storage_keys(hash, child_info, key_prefix)
}
}
}
fn child_storage_keys_iter<'a>(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
child_info: ChildInfo,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>,
......@@ -535,14 +535,14 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
self,
client,
{
client.child_storage_keys_iter(id, child_info, prefix, start_key)
client.child_storage_keys_iter(hash, child_info, prefix, start_key)
}
}
}
fn child_storage_hash(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
child_info: &ChildInfo,
key: &StorageKey,
) -> sp_blockchain::Result<Option<<Block as BlockT>::Hash>> {
......@@ -550,7 +550,7 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
self,
client,
{
client.child_storage_hash(id, child_info, key)
client.child_storage_hash(hash, child_info, key)
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment