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 Kucharczyk
2022-10-14 13:01:29 +02:00
committed by GitHub
parent e695dd905d
commit 25811e427d
2 changed files with 254 additions and 256 deletions
@@ -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)