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
+11 -8
View File
@@ -32,15 +32,16 @@ use sp_state_machine::BasicExternalities;
pub trait InitPolkadotBlockBuilder {
/// Init a Polkadot specific block builder that works for the test runtime.
///
/// This will automatically create and push the inherents for you to make the block valid for the test runtime.
/// This will automatically create and push the inherents for you to make the block valid for
/// the test runtime.
fn init_polkadot_block_builder(
&self,
) -> sc_block_builder::BlockBuilder<Block, Client, FullBackend>;
/// Init a Polkadot specific block builder at a specific block that works for the test runtime.
///
/// Same as [`InitPolkadotBlockBuilder::init_polkadot_block_builder`] besides that it takes a [`BlockId`] to say
/// which should be the parent block of the block that is being build.
/// Same as [`InitPolkadotBlockBuilder::init_polkadot_block_builder`] besides that it takes a
/// [`BlockId`] to say which should be the parent block of the block that is being build.
fn init_polkadot_block_builder_at(
&self,
hash: <Block as BlockT>::Hash,
@@ -60,7 +61,8 @@ impl InitPolkadotBlockBuilder for Client {
let last_timestamp =
self.runtime_api().get_last_timestamp(hash).expect("Get last timestamp");
// `MinimumPeriod` is a storage parameter type that requires externalities to access the value.
// `MinimumPeriod` is a storage parameter type that requires externalities to access the
// value.
let minimum_period = BasicExternalities::new_empty()
.execute_with(|| polkadot_test_runtime::MinimumPeriod::get());
@@ -73,7 +75,8 @@ impl InitPolkadotBlockBuilder for Client {
last_timestamp + minimum_period
};
// `SlotDuration` is a storage parameter type that requires externalities to access the value.
// `SlotDuration` is a storage parameter type that requires externalities to access the
// value.
let slot_duration = BasicExternalities::new_empty()
.execute_with(|| polkadot_test_runtime::SlotDuration::get());
@@ -130,9 +133,9 @@ impl InitPolkadotBlockBuilder for Client {
pub trait BlockBuilderExt {
/// Push a Polkadot test runtime specific extrinsic to the block.
///
/// This will internally use the [`BlockBuilder::push`] method, but this method expects a opaque extrinsic. So,
/// we provide this wrapper which converts a test runtime specific extrinsic to a opaque extrinsic and pushes it to
/// the block.
/// This will internally use the [`BlockBuilder::push`] method, but this method expects a opaque
/// extrinsic. So, we provide this wrapper which converts a test runtime specific extrinsic to a
/// opaque extrinsic and pushes it to the block.
///
/// Returns the result of the application of the extrinsic.
fn push_polkadot_extrinsic(