mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-01 03:21:02 +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:
@@ -1165,7 +1165,7 @@ where
|
||||
debug!(target: "afg", "Finding best chain containing block {:?} with number limit {:?}", block, limit);
|
||||
|
||||
let result = match select_chain.finality_target(block, None).await {
|
||||
Ok(Some(best_hash)) => {
|
||||
Ok(best_hash) => {
|
||||
let best_header = client
|
||||
.header(BlockId::Hash(best_hash))?
|
||||
.expect("Header known to exist after `finality_target` call; qed");
|
||||
@@ -1223,10 +1223,6 @@ where
|
||||
})
|
||||
.or_else(|| Some((target_header.hash(), *target_header.number())))
|
||||
},
|
||||
Ok(None) => {
|
||||
debug!(target: "afg", "Encountered error finding best chain containing {:?}: couldn't find target block", block);
|
||||
None
|
||||
},
|
||||
Err(e) => {
|
||||
debug!(target: "afg", "Encountered error finding best chain containing {:?}: {:?}", block, e);
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user