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
+14 -12
View File
@@ -58,8 +58,8 @@ pub(crate) enum Command {
#[derive(Debug, Clone, Parser)]
#[cfg_attr(test, derive(PartialEq))]
pub(crate) struct MonitorConfig {
/// The path to a file containing the seed of the account. If the file is not found, the seed is
/// used as-is.
/// The path to a file containing the seed of the account. If the file is not found, the seed
/// is used as-is.
///
/// Can also be provided via the `SEED` environment variable.
///
@@ -88,9 +88,11 @@ pub(crate) struct MonitorConfig {
///
/// `--submission-strategy always`: always submit.
///
/// `--submission-strategy "percent-better <percent>"`: submit if the submission is `n` percent better.
/// `--submission-strategy "percent-better <percent>"`: submit if the submission is `n` percent
/// better.
///
/// `--submission-strategy "no-worse-than <percent>"`: submit if submission is no more than `n` percent worse.
/// `--submission-strategy "no-worse-than <percent>"`: submit if submission is no more than
/// `n` percent worse.
#[clap(long, default_value = "if-leading")]
pub submission_strategy: SubmissionStrategy,
@@ -100,8 +102,8 @@ pub(crate) struct MonitorConfig {
/// a delay can be enforced to avoid submitting at
/// "same time" and risk potential races with other miners.
///
/// When this is enabled and there are competing solutions, your solution might not be submitted
/// if the scores are equal.
/// When this is enabled and there are competing solutions, your solution might not be
/// submitted if the scores are equal.
#[arg(long, default_value_t = 0)]
pub delay: usize,
}
@@ -109,8 +111,8 @@ pub(crate) struct MonitorConfig {
#[derive(Debug, Clone, Parser)]
#[cfg_attr(test, derive(PartialEq))]
pub(crate) struct DryRunConfig {
/// The path to a file containing the seed of the account. If the file is not found, the seed is
/// used as-is.
/// The path to a file containing the seed of the account. If the file is not found, the seed
/// is used as-is.
///
/// Can also be provided via the `SEED` environment variable.
///
@@ -165,8 +167,8 @@ pub enum SubmissionStrategy {
IfLeading,
/// Submit if we are no worse than `Perbill` worse than the best.
ClaimNoWorseThan(Perbill),
/// Submit if we are leading, or if the solution that's leading is more that the given `Perbill`
/// better than us. This helps detect obviously fake solutions and still combat them.
/// Submit if we are leading, or if the solution that's leading is more that the given
/// `Perbill` better than us. This helps detect obviously fake solutions and still combat them.
ClaimBetterThan(Perbill),
}
@@ -189,8 +191,8 @@ pub(crate) enum Solver {
/// * --submission-strategy if-leading: only submit if leading
/// * --submission-strategy always: always submit
/// * --submission-strategy "percent-better <percent>": submit if submission is `n` percent better.
/// * --submission-strategy "no-worse-than<percent>": submit if submission is no more than `n` percent worse.
///
/// * --submission-strategy "no-worse-than<percent>": submit if submission is no more than `n`
/// percent worse.
impl FromStr for SubmissionStrategy {
type Err = String;
+2 -1
View File
@@ -61,7 +61,8 @@ pub trait RpcApi {
at: Option<&Hash>,
) -> RpcResult<RuntimeDispatchInfo<Balance>>;
/// Dry run an extrinsic at a given block. Return SCALE encoded [`sp_runtime::ApplyExtrinsicResult`].
/// Dry run an extrinsic at a given block. Return SCALE encoded
/// [`sp_runtime::ApplyExtrinsicResult`].
#[method(name = "system_dryRun")]
async fn dry_run(&self, extrinsic: &Bytes, at: Option<Hash>) -> RpcResult<Bytes>;