mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 05:21:08 +00:00
Return target_hash for finality_target instead of an Option (#9867)
* . cargo +nightly fmt --all * Fix test * Simplify test * They are already imported * Needless clone()
This commit is contained in:
@@ -91,11 +91,12 @@ where
|
||||
&self,
|
||||
target_hash: Block::Hash,
|
||||
maybe_max_number: Option<NumberFor<Block>>,
|
||||
) -> Result<Option<Block::Hash>, ConsensusError> {
|
||||
) -> Result<Block::Hash, ConsensusError> {
|
||||
let import_lock = self.backend.get_import_lock();
|
||||
self.backend
|
||||
.blockchain()
|
||||
.best_containing(target_hash, maybe_max_number, import_lock)
|
||||
.map(|maybe_hash| maybe_hash.unwrap_or(target_hash))
|
||||
.map_err(|e| ConsensusError::ChainLookup(e.to_string()).into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user