Use same fmt and clippy configs as in Substrate (#7611)

* Use same rustfmt.toml as Substrate

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* format format file

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Format with new config

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add Substrate Clippy config

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Print Clippy version in CI

Otherwise its difficult to reproduce locally.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make fmt happy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update node/core/pvf/src/error.rs

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

* Update node/core/pvf/src/error.rs

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-08-14 16:29:29 +02:00
committed by GitHub
parent ac435c96cf
commit 342d720573
203 changed files with 1880 additions and 1504 deletions
+9 -8
View File
@@ -287,13 +287,13 @@ impl IsSystem for Sibling {
}
}
/// A type that uniquely identifies an HRMP channel. An HRMP channel is established between two paras.
/// In text, we use the notation `(A, B)` to specify a channel between A and B. The channels are
/// unidirectional, meaning that `(A, B)` and `(B, A)` refer to different channels. The convention is
/// that we use the first item tuple for the sender and the second for the recipient. Only one channel
/// is allowed between two participants in one direction, i.e. there cannot be 2 different channels
/// identified by `(A, B)`. A channel with the same para id in sender and recipient is invalid. That
/// is, however, not enforced.
/// A type that uniquely identifies an HRMP channel. An HRMP channel is established between two
/// paras. In text, we use the notation `(A, B)` to specify a channel between A and B. The channels
/// are unidirectional, meaning that `(A, B)` and `(B, A)` refer to different channels. The
/// convention is that we use the first item tuple for the sender and the second for the recipient.
/// Only one channel is allowed between two participants in one direction, i.e. there cannot be 2
/// different channels identified by `(A, B)`. A channel with the same para id in sender and
/// recipient is invalid. That is, however, not enforced.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, RuntimeDebug, TypeInfo)]
#[cfg_attr(feature = "std", derive(Hash))]
pub struct HrmpChannelId {
@@ -414,6 +414,7 @@ pub struct ValidationResult {
///
/// It is expected that the Parachain processes them from first to last.
pub processed_downward_messages: u32,
/// The mark which specifies the block number up to which all inbound HRMP messages are processed.
/// The mark which specifies the block number up to which all inbound HRMP messages are
/// processed.
pub hrmp_watermark: RelayChainBlockNumber,
}
@@ -147,7 +147,8 @@ impl Collator {
/// Create the collation function.
///
/// This collation function can be plugged into the overseer to generate collations for the adder parachain.
/// This collation function can be plugged into the overseer to generate collations for the
/// adder parachain.
pub fn create_collation_function(
&self,
spawner: impl SpawnNamed + Clone + 'static,
@@ -228,8 +229,9 @@ impl Collator {
/// Wait until `seconded` collations of this collator are seconded by a parachain validator.
///
/// The internal counter isn't de-duplicating the collations when counting the number of seconded collations. This
/// means when one collation is seconded by X validators, we record X seconded messages.
/// The internal counter isn't de-duplicating the collations when counting the number of
/// seconded collations. This means when one collation is seconded by X validators, we record X
/// seconded messages.
pub async fn wait_for_seconded_collations(&self, seconded: u32) {
let seconded_collations = self.seconded_collations.clone();
loop {
@@ -19,7 +19,8 @@
const PUPPET_EXE: &str = env!("CARGO_BIN_EXE_adder_collator_puppet_worker");
// If this test is failing, make sure to run all tests with the `real-overseer` feature being enabled.
// If this test is failing, make sure to run all tests with the `real-overseer` feature being
// enabled.
#[substrate_test_utils::test(flavor = "multi_thread")]
async fn collating_using_adder_collator() {
@@ -221,7 +221,8 @@ impl Collator {
/// Create the collation function.
///
/// This collation function can be plugged into the overseer to generate collations for the undying parachain.
/// This collation function can be plugged into the overseer to generate collations for the
/// undying parachain.
pub fn create_collation_function(
&self,
spawner: impl SpawnNamed + Clone + 'static,
@@ -309,8 +310,9 @@ impl Collator {
/// Wait until `seconded` collations of this collator are seconded by a parachain validator.
///
/// The internal counter isn't de-duplicating the collations when counting the number of seconded collations. This
/// means when one collation is seconded by X validators, we record X seconded messages.
/// The internal counter isn't de-duplicating the collations when counting the number of
/// seconded collations. This means when one collation is seconded by X validators, we record X
/// seconded messages.
pub async fn wait_for_seconded_collations(&self, seconded: u32) {
let seconded_collations = self.seconded_collations.clone();
loop {
@@ -19,7 +19,8 @@
const PUPPET_EXE: &str = env!("CARGO_BIN_EXE_undying_collator_puppet_worker");
// If this test is failing, make sure to run all tests with the `real-overseer` feature being enabled.
// If this test is failing, make sure to run all tests with the `real-overseer` feature being
// enabled.
#[substrate_test_utils::test(flavor = "multi_thread")]
async fn collating_using_undying_collator() {
use polkadot_primitives::Id as ParaId;