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(
+7 -5
View File
@@ -257,7 +257,8 @@ pub struct PolkadotTestNode {
pub client: Arc<Client>,
/// A handle to Overseer.
pub overseer_handle: Handle,
/// The `MultiaddrWithPeerId` to this node. This is useful if you want to pass it as "boot node" to other nodes.
/// The `MultiaddrWithPeerId` to this node. This is useful if you want to pass it as "boot
/// node" to other nodes.
pub addr: MultiaddrWithPeerId,
/// `RPCHandlers` to make RPC queries.
pub rpc_handlers: RpcHandlers,
@@ -312,14 +313,15 @@ impl PolkadotTestNode {
self.send_sudo(call, Sr25519Keyring::Alice, 1).await
}
/// Wait for `count` blocks to be imported in the node and then exit. This function will not return if no blocks
/// are ever created, thus you should restrict the maximum amount of time of the test execution.
/// Wait for `count` blocks to be imported in the node and then exit. This function will not
/// return if no blocks are ever created, thus you should restrict the maximum amount of time of
/// the test execution.
pub fn wait_for_blocks(&self, count: usize) -> impl Future<Output = ()> {
self.client.wait_for_blocks(count)
}
/// Wait for `count` blocks to be finalized and then exit. Similarly with `wait_for_blocks` this function will
/// not return if no block are ever finalized.
/// Wait for `count` blocks to be finalized and then exit. Similarly with `wait_for_blocks` this
/// function will not return if no block are ever finalized.
pub async fn wait_for_finalized_blocks(&self, count: usize) {
let mut import_notification_stream = self.client.finality_notification_stream();
let mut blocks = HashSet::new();