mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
ci: add quick-check with rustfmt (#615)
* ci: add quick-check with clippy and rustfmt * chore: rustfmt round * chore: set the same rustfmt config than substrate * chore: fix formatting * cI: remove clippy * ci: switch to nightly for the checks * ci: fix toolchains and naming * ci: Limit the check to formatting * chore: fix formatting * Update .rustfmt.toml * Update .rustfmt.toml Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@ where
|
||||
h
|
||||
} else {
|
||||
tracing::debug!(target: "cumulus-consensus", "Stopping following finalized head.");
|
||||
return;
|
||||
return
|
||||
};
|
||||
|
||||
let header = match Block::Header::decode(&mut &finalized_head[..]) {
|
||||
@@ -86,8 +86,8 @@ where
|
||||
error = ?err,
|
||||
"Could not decode parachain header while following finalized heads.",
|
||||
);
|
||||
continue;
|
||||
}
|
||||
continue
|
||||
},
|
||||
};
|
||||
|
||||
let hash = header.hash();
|
||||
@@ -140,12 +140,8 @@ pub async fn run_parachain_consensus<P, R, Block, B>(
|
||||
R: RelaychainClient,
|
||||
B: Backend<Block>,
|
||||
{
|
||||
let follow_new_best = follow_new_best(
|
||||
para_id,
|
||||
parachain.clone(),
|
||||
relay_chain.clone(),
|
||||
announce_block,
|
||||
);
|
||||
let follow_new_best =
|
||||
follow_new_best(para_id, parachain.clone(), relay_chain.clone(), announce_block);
|
||||
let follow_finalized_head = follow_finalized_head(para_id, parachain, relay_chain);
|
||||
select! {
|
||||
_ = follow_new_best.fuse() => {},
|
||||
@@ -242,12 +238,12 @@ async fn handle_new_block_imported<Block, P>(
|
||||
};
|
||||
|
||||
let unset_hash = if notification.header.number() < unset_best_header.number() {
|
||||
return;
|
||||
return
|
||||
} else if notification.header.number() == unset_best_header.number() {
|
||||
let unset_hash = unset_best_header.hash();
|
||||
|
||||
if unset_hash != notification.hash {
|
||||
return;
|
||||
return
|
||||
} else {
|
||||
unset_hash
|
||||
}
|
||||
@@ -263,7 +259,7 @@ async fn handle_new_block_imported<Block, P>(
|
||||
.expect("We checked above that the value is set; qed");
|
||||
|
||||
import_block_as_new_best(unset_hash, unset_best_header, parachain).await;
|
||||
}
|
||||
},
|
||||
state => tracing::debug!(
|
||||
target: "cumulus-consensus",
|
||||
?unset_best_header,
|
||||
@@ -292,8 +288,8 @@ async fn handle_new_best_parachain_head<Block, P>(
|
||||
error = ?err,
|
||||
"Could not decode Parachain header while following best heads.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
return
|
||||
},
|
||||
};
|
||||
|
||||
let hash = parachain_head.hash();
|
||||
@@ -311,14 +307,14 @@ async fn handle_new_best_parachain_head<Block, P>(
|
||||
unset_best_header.take();
|
||||
|
||||
import_block_as_new_best(hash, parachain_head, parachain).await;
|
||||
}
|
||||
},
|
||||
Ok(BlockStatus::InChainPruned) => {
|
||||
tracing::error!(
|
||||
target: "cumulus-collator",
|
||||
block_hash = ?hash,
|
||||
"Trying to set pruned block as new best!",
|
||||
);
|
||||
}
|
||||
},
|
||||
Ok(BlockStatus::Unknown) => {
|
||||
*unset_best_header = Some(parachain_head);
|
||||
|
||||
@@ -327,7 +323,7 @@ async fn handle_new_best_parachain_head<Block, P>(
|
||||
block_hash = ?hash,
|
||||
"Parachain block not yet imported, waiting for import to enact as best block.",
|
||||
);
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
tracing::error!(
|
||||
target: "cumulus-collator",
|
||||
@@ -335,8 +331,8 @@ async fn handle_new_best_parachain_head<Block, P>(
|
||||
error = ?e,
|
||||
"Failed to get block status of block.",
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,7 +352,7 @@ where
|
||||
"Skipping importing block as new best block, because there already exists a \
|
||||
best block with an higher number",
|
||||
);
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
// Make it the new best block
|
||||
@@ -364,10 +360,7 @@ where
|
||||
block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom(true));
|
||||
block_import_params.import_existing = true;
|
||||
|
||||
if let Err(err) = (&*parachain)
|
||||
.import_block(block_import_params, Default::default())
|
||||
.await
|
||||
{
|
||||
if let Err(err) = (&*parachain).import_block(block_import_params, Default::default()).await {
|
||||
tracing::warn!(
|
||||
target: "cumulus-consensus",
|
||||
block_hash = ?hash,
|
||||
@@ -392,10 +385,7 @@ where
|
||||
self.import_notification_stream()
|
||||
.filter_map(move |n| {
|
||||
future::ready(if n.is_new_best {
|
||||
relay_chain
|
||||
.parachain_head_at(&BlockId::hash(n.hash), para_id)
|
||||
.ok()
|
||||
.flatten()
|
||||
relay_chain.parachain_head_at(&BlockId::hash(n.hash), para_id).ok().flatten()
|
||||
} else {
|
||||
None
|
||||
})
|
||||
@@ -409,10 +399,7 @@ where
|
||||
self.finality_notification_stream()
|
||||
.filter_map(move |n| {
|
||||
future::ready(
|
||||
relay_chain
|
||||
.parachain_head_at(&BlockId::hash(n.hash), para_id)
|
||||
.ok()
|
||||
.flatten(),
|
||||
relay_chain.parachain_head_at(&BlockId::hash(n.hash), para_id).ok().flatten(),
|
||||
)
|
||||
})
|
||||
.boxed()
|
||||
|
||||
Reference in New Issue
Block a user