mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +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
|
||||
|
||||
@@ -118,10 +118,10 @@ where
|
||||
)
|
||||
.await
|
||||
} else {
|
||||
Ok(Some(pending_change.canon_hash))
|
||||
Ok(pending_change.canon_hash)
|
||||
};
|
||||
|
||||
if let Ok(Some(hash)) = effective_block_hash {
|
||||
if let Ok(hash) = effective_block_hash {
|
||||
if let Ok(Some(header)) = self.inner.header(BlockId::Hash(hash)) {
|
||||
if *header.number() == pending_change.effective_number() {
|
||||
out.push((header.hash(), *header.number()));
|
||||
|
||||
Reference in New Issue
Block a user