Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

BlockId removal refactor: Backend::state_at #1760

Merged
merged 3 commits into from
Oct 14, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions client/relay-chain-inprocess-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
Expand Down