BlockId removal refactor: Backend::state_at (#1760)

* BlockId removal refactor: Backend::state_at

* corrected

* update lockfile for {"substrate", "polkadot"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Michal Kucharczykandparity-processbot authored and GitHub committed 2022-10-14 11:01:29 +00:00
1 parent 8cb4283032
commit 48b3a122ef
2 files changed
+254 -256

No files matched your search

+252 -252
View File
File diff suppressed because it is too large. Load diff
@@ -180,8 +180,7 @@ where
relay_parent: PHash,
key: &[u8],
) -> RelayChainResult<Option<StorageValue>> {
let block_id = BlockId::Hash(relay_parent);
let state = self.backend.state_at(block_id)?;
let state = self.backend.state_at(&relay_parent)?;
state.storage(key).map_err(RelayChainError::GenericError)
}
@@ -190,8 +189,7 @@ where
relay_parent: PHash,
relevant_keys: &Vec<Vec<u8>>,
) -> RelayChainResult<StorageProof> {
let block_id = BlockId::Hash(relay_parent);
let state_backend = self.backend.state_at(block_id)?;
let state_backend = self.backend.state_at(&relay_parent)?;
sp_state_machine::prove_read(state_backend, relevant_keys)
.map_err(RelayChainError::StateMachineError)