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
@@ -105,8 +105,8 @@ impl DisputeMessage {
/// - the invalid statement is indeed an invalid one
/// - the valid statement is indeed a valid one
/// - The passed `CandidateReceipt` has the correct hash (as signed in the statements).
/// - the given validator indices match with the given `ValidatorId`s in the statements,
/// given a `SessionInfo`.
/// - the given validator indices match with the given `ValidatorId`s in the statements, given a
/// `SessionInfo`.
///
/// We don't check whether the given `SessionInfo` matches the `SessionIndex` in the
/// statements, because we can't without doing a runtime query. Nevertheless this smart
@@ -16,7 +16,8 @@
use parity_scale_codec::{Decode, Encode};
/// Timestamp based on the 1 Jan 1970 UNIX base, which is persistent across node restarts and OS reboots.
/// Timestamp based on the 1 Jan 1970 UNIX base, which is persistent across node restarts and OS
/// reboots.
pub type Timestamp = u64;
/// The status of dispute.
@@ -88,8 +89,8 @@ impl DisputeStatus {
}
}
/// Transition the status to a new status after observing the dispute has concluded for the candidate.
/// This may be a no-op if the status was already concluded.
/// Transition the status to a new status after observing the dispute has concluded for the
/// candidate. This may be a no-op if the status was already concluded.
pub fn conclude_for(self, now: Timestamp) -> DisputeStatus {
match self {
DisputeStatus::Active | DisputeStatus::Confirmed => DisputeStatus::ConcludedFor(now),
@@ -98,8 +99,8 @@ impl DisputeStatus {
}
}
/// Transition the status to a new status after observing the dispute has concluded against the candidate.
/// This may be a no-op if the status was already concluded.
/// Transition the status to a new status after observing the dispute has concluded against the
/// candidate. This may be a no-op if the status was already concluded.
pub fn conclude_against(self, now: Timestamp) -> DisputeStatus {
match self {
DisputeStatus::Active | DisputeStatus::Confirmed =>
+14 -12
View File
@@ -180,8 +180,8 @@ impl std::fmt::Debug for Statement {
impl Statement {
/// Get the candidate hash referenced by this statement.
///
/// If this is a `Statement::Seconded`, this does hash the candidate receipt, which may be expensive
/// for large candidates.
/// If this is a `Statement::Seconded`, this does hash the candidate receipt, which may be
/// expensive for large candidates.
pub fn candidate_hash(&self) -> CandidateHash {
match *self {
Statement::Valid(ref h) => *h,
@@ -215,8 +215,8 @@ impl EncodeAs<CompactStatement> for Statement {
///
/// Signing context and validator set should be apparent from context.
///
/// This statement is "full" in the sense that the `Seconded` variant includes the candidate receipt.
/// Only the compact `SignedStatement` is suitable for submission to the chain.
/// This statement is "full" in the sense that the `Seconded` variant includes the candidate
/// receipt. Only the compact `SignedStatement` is suitable for submission to the chain.
pub type SignedFullStatement = Signed<Statement, CompactStatement>;
/// Variant of `SignedFullStatement` where the signature has not yet been verified.
@@ -256,8 +256,8 @@ pub enum InvalidCandidate {
/// Result of the validation of the candidate.
#[derive(Debug)]
pub enum ValidationResult {
/// Candidate is valid. The validation process yields these outputs and the persisted validation
/// data used to form inputs.
/// Candidate is valid. The validation process yields these outputs and the persisted
/// validation data used to form inputs.
Valid(CandidateCommitments, PersistedValidationData),
/// Candidate is invalid.
Invalid(InvalidCandidate),
@@ -321,7 +321,8 @@ pub struct Collation<BlockNumber = polkadot_primitives::BlockNumber> {
pub proof_of_validity: MaybeCompressedPoV,
/// The number of messages processed from the DMQ.
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: BlockNumber,
}
@@ -344,9 +345,9 @@ pub struct CollationResult {
pub collation: Collation,
/// An optional result sender that should be informed about a successfully seconded collation.
///
/// There is no guarantee that this sender is informed ever about any result, it is completely okay to just drop it.
/// However, if it is called, it should be called with the signed statement of a parachain validator seconding the
/// collation.
/// There is no guarantee that this sender is informed ever about any result, it is completely
/// okay to just drop it. However, if it is called, it should be called with the signed
/// statement of a parachain validator seconding the collation.
pub result_sender: Option<futures::channel::oneshot::Sender<CollationSecondedSignal>>,
}
@@ -362,8 +363,9 @@ impl CollationResult {
/// Collation function.
///
/// Will be called with the hash of the relay chain block the parachain block should be build on and the
/// [`ValidationData`] that provides information about the state of the parachain on the relay chain.
/// Will be called with the hash of the relay chain block the parachain block should be build on and
/// the [`ValidationData`] that provides information about the state of the parachain on the relay
/// chain.
///
/// Returns an optional [`CollationResult`].
#[cfg(not(target_os = "unknown"))]