BlockId removal: &Hash to Hash (#12626)

It changes &Block::Hash argument to Block::Hash.

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
This commit is contained in:
Michal Kucharczyk
2022-11-07 22:42:16 +01:00
committed by GitHub
parent 7c4bfc9749
commit 1ed70004e7
49 changed files with 428 additions and 441 deletions
@@ -424,8 +424,8 @@ where
}
/// Read current set id form a given state.
fn current_set_id(&self, hash: &Block::Hash) -> Result<SetId, ConsensusError> {
let id = &BlockId::hash(*hash);
fn current_set_id(&self, hash: Block::Hash) -> Result<SetId, ConsensusError> {
let id = &BlockId::hash(hash);
let runtime_version = self.inner.runtime_api().version(id).map_err(|e| {
ConsensusError::ClientImport(format!(
"Unable to retrieve current runtime version. {}",
@@ -480,7 +480,7 @@ where
.runtime_api()
.grandpa_authorities(&BlockId::hash(hash))
.map_err(|e| ConsensusError::ClientImport(e.to_string()))?;
let set_id = self.current_set_id(&hash)?;
let set_id = self.current_set_id(hash)?;
let authority_set = AuthoritySet::new(
authorities.clone(),
set_id,