mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
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:
committed by
GitHub
parent
7c4bfc9749
commit
1ed70004e7
@@ -173,12 +173,12 @@ impl PeersClient {
|
||||
Some(header) => header,
|
||||
None => return false,
|
||||
};
|
||||
self.backend.have_state_at(&header.hash(), *header.number())
|
||||
self.backend.have_state_at(header.hash(), *header.number())
|
||||
}
|
||||
|
||||
pub fn justifications(
|
||||
&self,
|
||||
hash: &<Block as BlockT>::Hash,
|
||||
hash: <Block as BlockT>::Hash,
|
||||
) -> ClientResult<Option<Justifications>> {
|
||||
self.client.justifications(hash)
|
||||
}
|
||||
@@ -193,7 +193,7 @@ impl PeersClient {
|
||||
|
||||
pub fn finalize_block(
|
||||
&self,
|
||||
hash: &<Block as BlockT>::Hash,
|
||||
hash: <Block as BlockT>::Hash,
|
||||
justification: Option<Justification>,
|
||||
notify: bool,
|
||||
) -> ClientResult<()> {
|
||||
@@ -535,14 +535,14 @@ where
|
||||
self.verifier.failed_verifications.lock().clone()
|
||||
}
|
||||
|
||||
pub fn has_block(&self, hash: &H256) -> bool {
|
||||
pub fn has_block(&self, hash: H256) -> bool {
|
||||
self.backend
|
||||
.as_ref()
|
||||
.map(|backend| backend.blockchain().header(BlockId::hash(*hash)).unwrap().is_some())
|
||||
.map(|backend| backend.blockchain().header(BlockId::hash(hash)).unwrap().is_some())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn has_body(&self, hash: &H256) -> bool {
|
||||
pub fn has_body(&self, hash: H256) -> bool {
|
||||
self.backend
|
||||
.as_ref()
|
||||
.map(|backend| backend.blockchain().body(hash).unwrap().is_some())
|
||||
@@ -1124,7 +1124,7 @@ impl JustificationImport<Block> for ForceFinalized {
|
||||
justification: Justification,
|
||||
) -> Result<(), Self::Error> {
|
||||
self.0
|
||||
.finalize_block(&hash, Some(justification), true)
|
||||
.finalize_block(hash, Some(justification), true)
|
||||
.map_err(|_| ConsensusError::InvalidJustification)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user