From 234b821d4a52a6cd88d1c4a6d43cf4d76708c969 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Mon, 14 Aug 2023 22:30:12 +0200 Subject: [PATCH] Use same `fmt` and `clippy` configs as in Polkadot (#3004) * Copy rustfmt.toml from Polkadot master Signed-off-by: Oliver Tale-Yazdi * Format with new config Signed-off-by: Oliver Tale-Yazdi * Add Polkadot clippy config Signed-off-by: Oliver Tale-Yazdi * Update Cargo.lock Looks like https://github.com/paritytech/polkadot/pull/7611 did not correctly update the lockfile. Maybe a different Rust Version?! Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- .cargo/config.toml | 1 + .rustfmt.toml | 12 ++++-- client/cli/src/lib.rs | 3 +- client/collator/src/service.rs | 3 +- client/consensus/common/src/lib.rs | 20 +++++----- .../common/src/parachain_consensus.rs | 4 +- client/consensus/proposer/src/lib.rs | 4 +- client/consensus/relay-chain/src/lib.rs | 3 +- client/network/src/lib.rs | 13 +++--- client/pov-recovery/src/lib.rs | 19 ++++----- .../src/lib.rs | 14 ++++--- client/relay-chain-rpc-interface/src/lib.rs | 3 +- .../src/reconnecting_ws_client.rs | 8 ++-- .../src/rpc_client.rs | 3 +- client/service/src/lib.rs | 6 ++- pallets/aura-ext/src/lib.rs | 10 ++--- pallets/collator-selection/src/weights.rs | 32 +++++++-------- pallets/dmp-queue/src/lib.rs | 9 +++-- pallets/parachain-system/src/lib.rs | 32 +++++++++------ .../src/relay_state_snapshot.rs | 29 ++++++++------ pallets/solo-to-para/src/lib.rs | 9 +++-- pallets/xcmp-queue/src/lib.rs | 22 +++++----- pallets/xcmp-queue/src/tests.rs | 4 +- .../src/tests/reserve_transfer.rs | 15 ++++--- .../src/tests/reserve_transfer.rs | 15 ++++--- .../src/tests/reserve_transfer.rs | 15 ++++--- .../assets/asset-hub-kusama/src/xcm_config.rs | 12 ++++-- .../assets/asset-hub-kusama/tests/tests.rs | 3 +- .../asset-hub-polkadot/src/xcm_config.rs | 9 +++-- .../assets/asset-hub-polkadot/tests/tests.rs | 3 +- .../assets/asset-hub-westend/src/lib.rs | 5 ++- .../asset-hub-westend/src/xcm_config.rs | 9 +++-- .../assets/asset-hub-westend/tests/tests.rs | 3 +- parachains/runtimes/assets/common/src/lib.rs | 6 ++- .../assets/test-utils/src/test_cases.rs | 18 ++++++--- .../bridge-hub-kusama/src/xcm_config.rs | 3 +- .../bridge-hub-polkadot/src/xcm_config.rs | 6 ++- .../bridge-hub-rococo/src/xcm_config.rs | 10 +++-- .../bridge-hubs/test-utils/src/test_cases.rs | 6 ++- .../src/fellowship/migration.rs | 40 +++++++++---------- .../src/fellowship/mod.rs | 6 ++- .../src/fellowship/tracks.rs | 3 +- .../collectives-polkadot/src/impls.rs | 8 ++-- .../collectives-polkadot/src/lib.rs | 5 +-- .../collectives-polkadot/src/xcm_config.rs | 3 +- .../contracts-rococo/src/xcm_config.rs | 6 ++- .../runtimes/testing/penpal/src/xcm_config.rs | 9 +++-- polkadot-parachain/src/service.rs | 3 +- primitives/core/src/lib.rs | 16 ++++---- .../parachain-inherent/src/client_side.rs | 3 +- primitives/parachain-inherent/src/lib.rs | 10 ++--- primitives/parachain-inherent/src/mock.rs | 3 +- primitives/timestamp/src/lib.rs | 16 ++++---- primitives/utility/src/lib.rs | 7 ++-- test/client/src/block_builder.rs | 3 +- test/relay-sproof-builder/src/lib.rs | 3 +- .../relay-validation-worker-provider/build.rs | 3 +- test/runtime/src/lib.rs | 4 +- test/service/src/lib.rs | 7 ++-- xcm/xcm-emulator/src/lib.rs | 5 ++- 60 files changed, 332 insertions(+), 232 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 66b28b3485d..4796a2c2696 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -29,4 +29,5 @@ rustflags = [ "-Aclippy::needless_option_as_deref", # false positives "-Aclippy::derivable_impls", # false positives "-Aclippy::stable_sort_primitive", # prefer stable sort + "-Aclippy::extra-unused-type-parameters", # stylistic ] diff --git a/.rustfmt.toml b/.rustfmt.toml index bfa2448ee17..e2c4a037f37 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -11,14 +11,18 @@ reorder_imports = true # Consistency newline_style = "Unix" +# Format comments +comment_width = 100 +wrap_comments = true + # Misc -binop_separator = "Back" chain_width = 80 -match_arm_blocks = false +spaces_around_ranges = false +binop_separator = "Back" +reorder_impl_items = false match_arm_leading_pipes = "Preserve" +match_arm_blocks = false match_block_trailing_comma = true -reorder_impl_items = false -spaces_around_ranges = false trailing_comma = "Vertical" trailing_semicolon = false use_field_init_shorthand = true diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 0dd6f43bec7..5e5fbc3920f 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -307,7 +307,8 @@ pub struct RunCmd { } impl RunCmd { - /// Create a [`NormalizedRunCmd`] which merges the `collator` cli argument into `validator` to have only one. + /// Create a [`NormalizedRunCmd`] which merges the `collator` cli argument into `validator` to + /// have only one. pub fn normalize(&self) -> NormalizedRunCmd { let mut new_base = self.base.clone(); diff --git a/client/collator/src/service.rs b/client/collator/src/service.rs index 89dee282108..c798cb84c23 100644 --- a/client/collator/src/service.rs +++ b/client/collator/src/service.rs @@ -175,7 +175,8 @@ where /// Fetch the collation info from the runtime. /// - /// Returns `Ok(Some(_))` on success, `Err(_)` on error or `Ok(None)` if the runtime api isn't implemented by the runtime. + /// Returns `Ok(Some(_))` on success, `Err(_)` on error or `Ok(None)` if the runtime api isn't + /// implemented by the runtime. pub fn fetch_collation_info( &self, block_hash: Block::Hash, diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index 48ac4e96344..3e762e98692 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -53,12 +53,14 @@ pub struct ParachainCandidate { pub proof: sp_trie::StorageProof, } -/// A specific parachain consensus implementation that can be used by a collator to produce candidates. +/// A specific parachain consensus implementation that can be used by a collator to produce +/// candidates. /// -/// The collator will call [`Self::produce_candidate`] every time there is a free core for the parachain -/// this collator is collating for. It is the job of the consensus implementation to decide if this -/// specific collator should build a candidate for the given relay chain block. The consensus -/// implementation could, for example, check whether this specific collator is part of a staked set. +/// The collator will call [`Self::produce_candidate`] every time there is a free core for the +/// parachain this collator is collating for. It is the job of the consensus implementation to +/// decide if this specific collator should build a candidate for the given relay chain block. The +/// consensus implementation could, for example, check whether this specific collator is part of a +/// staked set. #[async_trait::async_trait] pub trait ParachainConsensus: Send + Sync + dyn_clone::DynClone { /// Produce a new candidate at the given parent block and relay-parent blocks. @@ -94,8 +96,8 @@ impl ParachainConsensus for Box + Send + /// Parachain specific block import. /// /// This is used to set `block_import_params.fork_choice` to `false` as long as the block origin is -/// not `NetworkInitialSync`. The best block for parachains is determined by the relay chain. Meaning -/// we will update the best block, as it is included by the relay-chain. +/// not `NetworkInitialSync`. The best block for parachains is determined by the relay chain. +/// Meaning we will update the best block, as it is included by the relay-chain. pub struct ParachainBlockImport { inner: BI, monitor: Option>>, @@ -232,8 +234,8 @@ pub struct PotentialParent { /// a set of [`PotentialParent`]s which could be potential parents of a new block with this /// relay-parent according to the search parameters. /// -/// A parachain block is a potential parent if it is either the last included parachain block, the pending -/// parachain block (when `max_depth` >= 1), or all of the following hold: +/// A parachain block is a potential parent if it is either the last included parachain block, the +/// pending parachain block (when `max_depth` >= 1), or all of the following hold: /// * its parent is a potential parent /// * its relay-parent is within `ancestry_lookback` of the targeted relay-parent. /// * the block number is within `max_depth` blocks of the included block diff --git a/client/consensus/common/src/parachain_consensus.rs b/client/consensus/common/src/parachain_consensus.rs index 78f4e45cd81..5bbaa2893cf 100644 --- a/client/consensus/common/src/parachain_consensus.rs +++ b/client/consensus/common/src/parachain_consensus.rs @@ -176,8 +176,8 @@ where /// /// # Note /// -/// This will access the backend of the parachain and thus, this future should be spawned as blocking -/// task. +/// This will access the backend of the parachain and thus, this future should be spawned as +/// blocking task. pub async fn run_parachain_consensus( para_id: ParaId, parachain: Arc

, diff --git a/client/consensus/proposer/src/lib.rs b/client/consensus/proposer/src/lib.rs index 514ad58da74..9c607490a52 100644 --- a/client/consensus/proposer/src/lib.rs +++ b/client/consensus/proposer/src/lib.rs @@ -62,8 +62,8 @@ pub trait ProposerInterface { /// `ParachainInherentData`. /// /// Also specify any required inherent digests, the maximum proposal duration, - /// and the block size limit in bytes. See the documentation on [`sp_consensus::Proposer::propose`] - /// for more details on how to interpret these parameters. + /// and the block size limit in bytes. See the documentation on + /// [`sp_consensus::Proposer::propose`] for more details on how to interpret these parameters. /// /// The `InherentData` and `Digest` are left deliberately general in order to accommodate /// all possible collator selection algorithms or inherent creation mechanisms, diff --git a/client/consensus/relay-chain/src/lib.rs b/client/consensus/relay-chain/src/lib.rs index 529b78c1319..0f73aea88e8 100644 --- a/client/consensus/relay-chain/src/lib.rs +++ b/client/consensus/relay-chain/src/lib.rs @@ -23,7 +23,8 @@ //! //! 1. Each node that sees itself as a collator is free to build a parachain candidate. //! -//! 2. This parachain candidate is send to the parachain validators that are part of the relay chain. +//! 2. This parachain candidate is send to the parachain validators that are part of the relay +//! chain. //! //! 3. The parachain validators validate at most X different parachain candidates, where X is the //! total number of parachain validators. diff --git a/client/network/src/lib.rs b/client/network/src/lib.rs index 7783ba13b6c..b42342e5b77 100644 --- a/client/network/src/lib.rs +++ b/client/network/src/lib.rs @@ -87,7 +87,8 @@ impl Decode for BlockAnnounceData { impl BlockAnnounceData { /// Validate that the receipt, statement and announced header match. /// - /// This will not check the signature, for this you should use [`BlockAnnounceData::check_signature`]. + /// This will not check the signature, for this you should use + /// [`BlockAnnounceData::check_signature`]. fn validate(&self, encoded_header: Vec) -> Result<(), Validation> { let candidate_hash = if let CompactStatement::Seconded(h) = self.statement.unchecked_payload() { @@ -192,9 +193,9 @@ pub type BlockAnnounceValidator = /// Parachain specific block announce validator. /// -/// This is not required when the collation mechanism itself is sybil-resistant, as it is a spam protection -/// mechanism used to prevent nodes from dealing with unbounded numbers of blocks. For sybil-resistant -/// collation mechanisms, this will only slow things down. +/// This is not required when the collation mechanism itself is sybil-resistant, as it is a spam +/// protection mechanism used to prevent nodes from dealing with unbounded numbers of blocks. For +/// sybil-resistant collation mechanisms, this will only slow things down. /// /// This block announce validator is required if the parachain is running /// with the relay chain provided consensus to make sure each node only @@ -472,8 +473,8 @@ impl AssumeSybilResistance { /// announcements which come tagged with seconded messages. /// /// This is useful for backwards compatibility when upgrading nodes: old nodes will continue - /// to broadcast announcements with seconded messages, so these announcements shouldn't be rejected - /// and the peers not punished. + /// to broadcast announcements with seconded messages, so these announcements shouldn't be + /// rejected and the peers not punished. pub fn allow_seconded_messages() -> Self { AssumeSybilResistance(true) } diff --git a/client/pov-recovery/src/lib.rs b/client/pov-recovery/src/lib.rs index 62f31b6c061..1dafe282aab 100644 --- a/client/pov-recovery/src/lib.rs +++ b/client/pov-recovery/src/lib.rs @@ -19,18 +19,19 @@ //! A parachain needs to build PoVs that are send to the relay chain to progress. These PoVs are //! erasure encoded and one piece of it is stored by each relay chain validator. As the relay chain //! decides on which PoV per parachain to include and thus, to progess the parachain it can happen -//! that the block corresponding to this PoV isn't propagated in the parachain network. This can have -//! several reasons, either a malicious collator that managed to include its own PoV and doesn't want -//! to share it with the rest of the network or maybe a collator went down before it could distribute -//! the block in the network. When something like this happens we can use the PoV recovery algorithm -//! implemented in this crate to recover a PoV and to propagate it with the rest of the network. +//! that the block corresponding to this PoV isn't propagated in the parachain network. This can +//! have several reasons, either a malicious collator that managed to include its own PoV and +//! doesn't want to share it with the rest of the network or maybe a collator went down before it +//! could distribute the block in the network. When something like this happens we can use the PoV +//! recovery algorithm implemented in this crate to recover a PoV and to propagate it with the rest +//! of the network. //! //! It works in the following way: //! //! 1. For every included relay chain block we note the backed candidate of our parachain. If the //! block belonging to the PoV is already known, we do nothing. Otherwise we start -//! a timer that waits for a randomized time inside a specified interval before starting to recover -//! the PoV. +//! a timer that waits for a randomized time inside a specified interval before starting to +//! recover the PoV. //! //! 2. If between starting and firing the timer the block is imported, we skip the recovery of the //! PoV. @@ -39,8 +40,8 @@ //! //! 4a. After it is recovered, we restore the block and import it. //! -//! 4b. Since we are trying to recover pending candidates, availability is not guaranteed. If the block -//! PoV is not yet available, we retry. +//! 4b. Since we are trying to recover pending candidates, availability is not guaranteed. If the +//! block PoV is not yet available, we retry. //! //! If we need to recover multiple PoV blocks (which should hopefully not happen in real life), we //! make sure that the blocks are imported in the correct order. diff --git a/client/relay-chain-inprocess-interface/src/lib.rs b/client/relay-chain-inprocess-interface/src/lib.rs index 7dda9062cd7..8b4f813c727 100644 --- a/client/relay-chain-inprocess-interface/src/lib.rs +++ b/client/relay-chain-inprocess-interface/src/lib.rs @@ -44,7 +44,8 @@ use sp_state_machine::{Backend as StateBackend, StorageValue}; /// The timeout in seconds after that the waiting for a block should be aborted. const TIMEOUT_IN_SECONDS: u64 = 6; -/// Provides an implementation of the [`RelayChainInterface`] using a local in-process relay chain node. +/// Provides an implementation of the [`RelayChainInterface`] using a local in-process relay chain +/// node. #[derive(Clone)] pub struct RelayChainInProcessInterface { full_client: Arc, @@ -188,8 +189,8 @@ impl RelayChainInterface for RelayChainInProcessInterface { /// Wait for a given relay chain block in an async way. /// - /// The caller needs to pass the hash of a block it waits for and the function will return when the - /// block is available or an error occurred. + /// The caller needs to pass the hash of a block it waits for and the function will return when + /// the block is available or an error occurred. /// /// The waiting for the block is implemented as follows: /// @@ -199,10 +200,11 @@ impl RelayChainInterface for RelayChainInProcessInterface { /// /// 3. If the block isn't imported yet, add an import notification listener. /// - /// 4. Poll the import notification listener until the block is imported or the timeout is fired. + /// 4. Poll the import notification listener until the block is imported or the timeout is + /// fired. /// - /// The timeout is set to 6 seconds. This should be enough time to import the block in the current - /// round and if not, the new round of the relay chain already started anyway. + /// The timeout is set to 6 seconds. This should be enough time to import the block in the + /// current round and if not, the new round of the relay chain already started anyway. async fn wait_for_block(&self, hash: PHash) -> RelayChainResult<()> { let mut listener = match check_block_in_chain(self.backend.clone(), self.full_client.clone(), hash)? { diff --git a/client/relay-chain-rpc-interface/src/lib.rs b/client/relay-chain-rpc-interface/src/lib.rs index 964d47eff91..db01af3cdc0 100644 --- a/client/relay-chain-rpc-interface/src/lib.rs +++ b/client/relay-chain-rpc-interface/src/lib.rs @@ -184,7 +184,8 @@ impl RelayChainInterface for RelayChainRpcInterface { /// Wait for a given relay chain block /// - /// The hash of the block to wait for is passed. We wait for the block to arrive or return after a timeout. + /// The hash of the block to wait for is passed. We wait for the block to arrive or return after + /// a timeout. /// /// Implementation: /// 1. Register a listener to all new blocks. diff --git a/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs b/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs index 5b5babed0d6..0869dace733 100644 --- a/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs +++ b/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs @@ -403,9 +403,11 @@ impl ReconnectingWebsocketWorker { /// Run this worker to drive notification streams. /// The worker does the following: - /// - Listen for [`RpcDispatcherMessage`], perform requests and register new listeners for the notification streams - /// - Distribute incoming import, best head and finalization notifications to registered listeners. - /// If an error occurs during sending, the receiver has been closed and we remove the sender from the list. + /// - Listen for [`RpcDispatcherMessage`], perform requests and register new listeners for the + /// notification streams + /// - Distribute incoming import, best head and finalization notifications to registered + /// listeners. If an error occurs during sending, the receiver has been closed and we remove + /// the sender from the list. /// - Find a new valid RPC server to connect to in case the websocket connection is terminated. /// If the worker is not able to connec to an RPC server from the list, the worker shuts down. async fn run(mut self) { diff --git a/client/relay-chain-rpc-interface/src/rpc_client.rs b/client/relay-chain-rpc-interface/src/rpc_client.rs index a352269104f..0d7cf0bd4e4 100644 --- a/client/relay-chain-rpc-interface/src/rpc_client.rs +++ b/client/relay-chain-rpc-interface/src/rpc_client.rs @@ -399,7 +399,8 @@ impl RelayChainRpcClient { .await } - /// Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`. + /// Fetch the hash of the validation code used by a para, making the given + /// `OccupiedCoreAssumption`. pub async fn parachain_host_validation_code_hash( &self, at: RelayHash, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 117e203d1ab..712bdba9af4 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -377,7 +377,8 @@ where }) } -/// Creates a new background task to wait for the relay chain to sync up and retrieve the parachain header +/// Creates a new background task to wait for the relay chain to sync up and retrieve the parachain +/// header fn warp_sync_get( para_id: ParaId, relay_chain_interface: RCInterface, @@ -413,7 +414,8 @@ where receiver } -/// Waits for the relay chain to have finished syncing and then gets the parachain header that corresponds to the last finalized relay chain block. +/// Waits for the relay chain to have finished syncing and then gets the parachain header that +/// corresponds to the last finalized relay chain block. async fn wait_for_target_block( sender: oneshot::Sender<::Header>, para_id: ParaId, diff --git a/pallets/aura-ext/src/lib.rs b/pallets/aura-ext/src/lib.rs index 35892571f6f..4ca09105956 100644 --- a/pallets/aura-ext/src/lib.rs +++ b/pallets/aura-ext/src/lib.rs @@ -23,9 +23,9 @@ //! check the constructed block on the relay chain. //! //! ``` -//!# struct Runtime; -//!# struct Executive; -//!# struct CheckInherents; +//! # struct Runtime; +//! # struct Executive; +//! # struct CheckInherents; //! cumulus_pallet_parachain_system::register_validate_block! { //! Runtime = Runtime, //! BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, @@ -75,8 +75,8 @@ pub mod pallet { /// Serves as cache for the authorities. /// /// The authorities in AuRa are overwritten in `on_initialize` when we switch to a new session, - /// but we require the old authorities to verify the seal when validating a PoV. This will always - /// be updated to the latest AuRa authorities in `on_finalize`. + /// but we require the old authorities to verify the seal when validating a PoV. This will + /// always be updated to the latest AuRa authorities in `on_finalize`. #[pallet::storage] pub(crate) type Authorities = StorageValue< _, diff --git a/pallets/collator-selection/src/weights.rs b/pallets/collator-selection/src/weights.rs index 7d227da291a..a4a30d83361 100644 --- a/pallets/collator-selection/src/weights.rs +++ b/pallets/collator-selection/src/weights.rs @@ -85,12 +85,12 @@ impl WeightInfo for SubstrateWeight { /// Storage: Session NextKeys (r:1 w:0) /// Proof Skipped: Session NextKeys (max_values: None, max_size: None, mode: Measured) /// Storage: CollatorSelection Invulnerables (r:1 w:1) - /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(641), added: 1136, mode: MaxEncodedLen) - /// Storage: CollatorSelection Candidates (r:1 w:1) - /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(4802), added: 5297, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `b` is `[1, 19]`. + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(641), added: + /// 1136, mode: MaxEncodedLen) Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(4802), added: 5297, + /// mode: MaxEncodedLen) Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: + /// MaxEncodedLen) The range of component `b` is `[1, 19]`. /// The range of component `c` is `[1, 99]`. fn add_invulnerable(b: u32, c: u32) -> Weight { // Proof Size summary in bytes: @@ -109,8 +109,8 @@ impl WeightInfo for SubstrateWeight { .saturating_add(Weight::from_parts(0, 53).saturating_mul(c.into())) } /// Storage: CollatorSelection Invulnerables (r:1 w:1) - /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// The range of component `b` is `[1, 100]`. + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(3202), added: + /// 3697, mode: MaxEncodedLen) The range of component `b` is `[1, 100]`. fn remove_invulnerable(b: u32) -> Weight { // Proof Size summary in bytes: // Measured: `119 + b * (32 ±0)` @@ -172,12 +172,12 @@ impl WeightInfo for () { /// Storage: Session NextKeys (r:1 w:0) /// Proof Skipped: Session NextKeys (max_values: None, max_size: None, mode: Measured) /// Storage: CollatorSelection Invulnerables (r:1 w:1) - /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(641), added: 1136, mode: MaxEncodedLen) - /// Storage: CollatorSelection Candidates (r:1 w:1) - /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(4802), added: 5297, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `b` is `[1, 19]`. + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(641), added: + /// 1136, mode: MaxEncodedLen) Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(4802), added: 5297, + /// mode: MaxEncodedLen) Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: + /// MaxEncodedLen) The range of component `b` is `[1, 19]`. /// The range of component `c` is `[1, 99]`. fn add_invulnerable(b: u32, c: u32) -> Weight { // Proof Size summary in bytes: @@ -196,8 +196,8 @@ impl WeightInfo for () { .saturating_add(Weight::from_parts(0, 53).saturating_mul(c.into())) } /// Storage: CollatorSelection Invulnerables (r:1 w:1) - /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// The range of component `b` is `[1, 100]`. + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(3202), added: + /// 3697, mode: MaxEncodedLen) The range of component `b` is `[1, 100]`. fn remove_invulnerable(b: u32) -> Weight { // Proof Size summary in bytes: // Measured: `119 + b * (32 ±0)` diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index 627124da994..aca9025d9e3 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -306,8 +306,8 @@ pub mod pallet { } /// For an incoming downward message, this just adapts an XCM executor and executes DMP messages - /// immediately up until some `MaxWeight` at which point it errors. Their origin is asserted to be - /// the `Parent` location. + /// immediately up until some `MaxWeight` at which point it errors. Their origin is asserted to + /// be the `Parent` location. impl DmpMessageHandler for Pallet { fn handle_dmp_messages( iter: impl Iterator)>, @@ -367,8 +367,9 @@ pub mod pallet { required_weight, }); page_index.overweight_count += 1; - // Not needed for control flow, but only to ensure that the compiler - // understands that we won't attempt to re-use `data` later. + // Not needed for control flow, but only to ensure that the + // compiler understands that we won't attempt to re-use `data` + // later. continue } else { // not overweight. stop executing inline and enqueue normally diff --git a/pallets/parachain-system/src/lib.rs b/pallets/parachain-system/src/lib.rs index cb215272a00..27a12b953fa 100644 --- a/pallets/parachain-system/src/lib.rs +++ b/pallets/parachain-system/src/lib.rs @@ -547,10 +547,12 @@ pub mod pallet { Unauthorized, } - /// In case of a scheduled upgrade, this storage field contains the validation code to be applied. + /// In case of a scheduled upgrade, this storage field contains the validation code to be + /// applied. /// - /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][sp_core::storage::well_known_keys::CODE] - /// which will result the next block process with the new validation code. This concludes the upgrade process. + /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the + /// [`:code`][sp_core::storage::well_known_keys::CODE] which will result the next block process + /// with the new validation code. This concludes the upgrade process. #[pallet::storage] #[pallet::getter(fn new_validation_function)] pub(super) type PendingValidationCode = StorageValue<_, Vec, ValueQuery>; @@ -871,8 +873,8 @@ impl Pallet { /// Process all inbound horizontal messages relayed by the collator. /// - /// This is similar to `Pallet::process_inbound_downward_messages`, but works on multiple inbound - /// channels. + /// This is similar to `Pallet::process_inbound_downward_messages`, but works on multiple + /// inbound channels. /// /// **Panics** if either any of horizontal messages submitted by the collator was sent from /// a para which has no open channel to this parachain or if after processing @@ -988,7 +990,8 @@ impl Pallet { /// The implementation of the runtime upgrade functionality for parachains. pub fn schedule_code_upgrade(validation_function: Vec) -> DispatchResult { // Ensure that `ValidationData` exists. We do not care about the validation data per se, - // but we do care about the [`UpgradeRestrictionSignal`] which arrives with the same inherent. + // but we do care about the [`UpgradeRestrictionSignal`] which arrives with the same + // inherent. ensure!(>::exists(), Error::::ValidationDataNotAvailable,); ensure!(>::get().is_none(), Error::::ProhibitedByPolkadot); @@ -1012,7 +1015,8 @@ impl Pallet { /// Returns the [`CollationInfo`] of the current active block. /// - /// The given `header` is the header of the built block we are collecting the collation info for. + /// The given `header` is the header of the built block we are collecting the collation info + /// for. /// /// This is expected to be used by the /// [`CollectCollationInfo`](cumulus_primitives_core::CollectCollationInfo) runtime api. @@ -1175,7 +1179,8 @@ pub trait CheckInherents { pub trait OnSystemEvent { /// Called in each blocks once when the validation data is set by the inherent. fn on_validation_data(data: &PersistedValidationData); - /// Called when the validation code is being applied, aka from the next block on this is the new runtime. + /// Called when the validation code is being applied, aka from the next block on this is the new + /// runtime. fn on_validation_code_applied(); } @@ -1198,8 +1203,8 @@ pub trait RelaychainStateProvider { fn current_relay_chain_state() -> RelayChainState; } -/// Implements [`BlockNumberProvider`] that returns relay chain block number fetched from validation data. -/// When validation data is not available (e.g. within on_initialize), 0 will be returned. +/// Implements [`BlockNumberProvider`] that returns relay chain block number fetched from validation +/// data. When validation data is not available (e.g. within on_initialize), 0 will be returned. /// /// **NOTE**: This has been deprecated, please use [`RelaychainDataProvider`] #[deprecated = "Use `RelaychainDataProvider` instead"] @@ -1241,9 +1246,10 @@ impl RelaychainStateProvider for RelaychainDataProvider { } } -/// Implements [`BlockNumberProvider`] and [`RelaychainStateProvider`] that returns relevant relay data fetched from -/// validation data. -/// NOTE: When validation data is not available (e.g. within on_initialize), default values will be returned. +/// Implements [`BlockNumberProvider`] and [`RelaychainStateProvider`] that returns relevant relay +/// data fetched from validation data. +/// NOTE: When validation data is not available (e.g. within on_initialize), default values will be +/// returned. pub struct RelaychainDataProvider(sp_std::marker::PhantomData); impl BlockNumberProvider for RelaychainDataProvider { diff --git a/pallets/parachain-system/src/relay_state_snapshot.rs b/pallets/parachain-system/src/relay_state_snapshot.rs index 9ef14e136ea..8f371191a7e 100644 --- a/pallets/parachain-system/src/relay_state_snapshot.rs +++ b/pallets/parachain-system/src/relay_state_snapshot.rs @@ -47,7 +47,8 @@ pub struct MessagingStateSnapshot { /// If the value is absent on the relay chain this will be set to all zeros. pub dmq_mqc_head: relay_chain::Hash, - /// The current capacity of the upward message queue of the current parachain on the relay chain. + /// The current capacity of the upward message queue of the current parachain on the relay + /// chain. pub relay_dispatch_queue_remaining_capacity: RelayDispatchQueueRemainingCapacity, /// Information about all the inbound HRMP channels. @@ -195,9 +196,10 @@ impl RelayChainStateProof { // TODO paritytech/polkadot#6283: Remove all usages of `relay_dispatch_queue_size` // - // When the relay chain and all parachains support `relay_dispatch_queue_remaining_capacity`, - // this code here needs to be removed and above needs to be changed to `read_entry` that - // returns an error if `relay_dispatch_queue_remaining_capacity` can not be found/decoded. + // When the relay chain and all parachains support + // `relay_dispatch_queue_remaining_capacity`, this code here needs to be removed and above + // needs to be changed to `read_entry` that returns an error if + // `relay_dispatch_queue_remaining_capacity` can not be found/decoded. // // For now we just fallback to the old dispatch queue size on `ReadEntryErr::Absent`. // `ReadEntryErr::Decode` and `ReadEntryErr::Proof` are potentially subject to meddling @@ -259,8 +261,9 @@ impl RelayChainStateProof { egress_channels.push((recipient, hrmp_channel)); } - // NOTE that ingress_channels and egress_channels promise to be sorted. We satisfy this property - // by relying on the fact that `ingress_channel_index` and `egress_channel_index` are themselves sorted. + // NOTE that ingress_channels and egress_channels promise to be sorted. We satisfy this + // property by relying on the fact that `ingress_channel_index` and `egress_channel_index` + // are themselves sorted. Ok(MessagingStateSnapshot { dmq_mqc_head, relay_dispatch_queue_remaining_capacity, @@ -320,12 +323,12 @@ impl RelayChainStateProof { .map_err(Error::UpgradeRestriction) } - /// Read an entry given by the key and try to decode it. If the value specified by the key according - /// to the proof is empty, the `fallback` value will be returned. + /// Read an entry given by the key and try to decode it. If the value specified by the key + /// according to the proof is empty, the `fallback` value will be returned. /// - /// Returns `Err` in case the backend can't return the value under the specific key (likely due to - /// a malformed proof), in case the decoding fails, or in case where the value is empty in the relay - /// chain state and no fallback was provided. + /// Returns `Err` in case the backend can't return the value under the specific key (likely due + /// to a malformed proof), in case the decoding fails, or in case where the value is empty in + /// the relay chain state and no fallback was provided. pub fn read_entry(&self, key: &[u8], fallback: Option) -> Result where T: Decode, @@ -335,8 +338,8 @@ impl RelayChainStateProof { /// Read an optional entry given by the key and try to decode it. /// - /// Returns `Err` in case the backend can't return the value under the specific key (likely due to - /// a malformed proof) or if the value couldn't be decoded. + /// Returns `Err` in case the backend can't return the value under the specific key (likely due + /// to a malformed proof) or if the value couldn't be decoded. pub fn read_optional_entry(&self, key: &[u8]) -> Result, Error> where T: Decode, diff --git a/pallets/solo-to-para/src/lib.rs b/pallets/solo-to-para/src/lib.rs index a05a5121de1..5672ec4ece4 100644 --- a/pallets/solo-to-para/src/lib.rs +++ b/pallets/solo-to-para/src/lib.rs @@ -38,7 +38,8 @@ pub mod pallet { #[pallet::without_storage_info] pub struct Pallet(_); - /// In case of a scheduled migration, this storage field contains the custom head data to be applied. + /// In case of a scheduled migration, this storage field contains the custom head data to be + /// applied. #[pallet::storage] pub(super) type PendingCustomValidationHeadData = StorageValue<_, Vec, OptionQuery>; @@ -48,7 +49,8 @@ pub mod pallet { pub enum Event { /// The custom validation head data has been scheduled to apply. CustomValidationHeadDataStored, - /// The custom validation head data was applied as of the contained relay chain block number. + /// The custom validation head data was applied as of the contained relay chain block + /// number. CustomValidationHeadDataApplied, } @@ -83,7 +85,8 @@ pub mod pallet { Self::deposit_event(Event::CustomValidationHeadDataStored); } - /// Set pending custom head data as head data that will be returned by `validate_block`. on the relay chain. + /// Set pending custom head data as head data that will be returned by `validate_block`. on + /// the relay chain. fn set_pending_custom_validation_head_data() { if let Some(head_data) = >::take() { parachain_system::Pallet::::set_custom_validation_head_data(head_data); diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index b7b3c64f218..d48de35cef0 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -187,8 +187,8 @@ pub mod pallet { Ok(()) } - /// Overwrites the number of pages of messages which must be in the queue for the other side to be told to - /// suspend their sending. + /// Overwrites the number of pages of messages which must be in the queue for the other side + /// to be told to suspend their sending. /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.suspend_value` @@ -201,8 +201,8 @@ pub mod pallet { Ok(()) } - /// Overwrites the number of pages of messages which must be in the queue after which we drop any further - /// messages from the channel. + /// Overwrites the number of pages of messages which must be in the queue after which we + /// drop any further messages from the channel. /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.drop_threshold` @@ -215,8 +215,8 @@ pub mod pallet { Ok(()) } - /// Overwrites the number of pages of messages which the queue must be reduced to before it signals that - /// message sending may recommence after it has been suspended. + /// Overwrites the number of pages of messages which the queue must be reduced to before it + /// signals that message sending may recommence after it has been suspended. /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.resume_threshold` @@ -243,7 +243,8 @@ pub mod pallet { } /// Overwrites the speed to which the available weight approaches the maximum weight. - /// A lower number results in a faster progression. A value of 1 makes the entire weight available initially. + /// A lower number results in a faster progression. A value of 1 makes the entire weight + /// available initially. /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.weight_restrict_decay`. @@ -257,7 +258,8 @@ pub mod pallet { } /// Overwrite the maximum amount of weight any individual message may consume. - /// Messages above this weight go into the overweight queue and may only be serviced explicitly. + /// Messages above this weight go into the overweight queue and may only be serviced + /// explicitly. /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.xcmp_max_individual_weight`. @@ -679,8 +681,8 @@ impl Pallet { Overweight::::count() < MAX_OVERWEIGHT_MESSAGES; weight_used.saturating_accrue(T::DbWeight::get().reads(1)); if is_under_limit { - // overweight - add to overweight queue and continue with message - // execution consuming the message. + // overweight - add to overweight queue and continue with + // message execution consuming the message. let msg_len = last_remaining_fragments .len() .saturating_sub(remaining_fragments.len()); diff --git a/pallets/xcmp-queue/src/tests.rs b/pallets/xcmp-queue/src/tests.rs index ad0fa906da3..45c4519d3aa 100644 --- a/pallets/xcmp-queue/src/tests.rs +++ b/pallets/xcmp-queue/src/tests.rs @@ -53,8 +53,8 @@ fn bad_message_is_handled() { }); } -/// Tests that a blob message is handled. Currently this isn't implemented and panics when debug assertions -/// are enabled. When this feature is enabled, this test should be rewritten properly. +/// Tests that a blob message is handled. Currently this isn't implemented and panics when debug +/// assertions are enabled. When this feature is enabled, this test should be rewritten properly. #[test] #[should_panic = "Blob messages not handled."] #[cfg(debug_assertions)] diff --git a/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs index d26f48215c1..9e11830acce 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs @@ -161,7 +161,8 @@ fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> Dispa ) } -/// Limited Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work +/// Limited Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't +/// work #[test] fn limited_reserve_transfer_native_asset_from_relay_to_system_para_fails() { // Init values for Relay Chain @@ -299,14 +300,16 @@ fn limited_reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; test.set_assertion::(system_para_to_para_assertions); - // TODO: Add assertion for Penpal runtime. Right now message is failing with `UntrustedReserveLocation` + // TODO: Add assertion for Penpal runtime. Right now message is failing with + // `UntrustedReserveLocation` test.set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); - // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve transfers + // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve + // transfers } /// Reserve Transfers of native asset from System Parachain to Parachain should work @@ -329,14 +332,16 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; test.set_assertion::(system_para_to_para_assertions); - // TODO: Add assertion for Penpal runtime. Right now message is failing with `UntrustedReserveLocation` + // TODO: Add assertion for Penpal runtime. Right now message is failing with + // `UntrustedReserveLocation` test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); - // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve transfers + // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve + // transfers } /// Limited Reserve Transfers of a local asset from System Parachain to Parachain should work diff --git a/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs index 6b1ecde6a14..7d773a5865e 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs @@ -161,7 +161,8 @@ fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> Dispa ) } -/// Limited Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work +/// Limited Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't +/// work #[test] fn limited_reserve_transfer_native_asset_from_relay_to_system_para_fails() { // Init values for Relay Chain @@ -299,14 +300,16 @@ fn limited_reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; test.set_assertion::(system_para_to_para_assertions); - // TODO: Add assertion for Penpal runtime. Right now message is failing with `UntrustedReserveLocation` + // TODO: Add assertion for Penpal runtime. Right now message is failing with + // `UntrustedReserveLocation` test.set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); - // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve transfers + // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve + // transfers } /// Reserve Transfers of native asset from System Parachain to Parachain should work @@ -329,14 +332,16 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; test.set_assertion::(system_para_to_para_assertions); - // TODO: Add assertion for Penpal runtime. Right now message is failing with `UntrustedReserveLocation` + // TODO: Add assertion for Penpal runtime. Right now message is failing with + // `UntrustedReserveLocation` test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); - // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve transfers + // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve + // transfers } /// Limited Reserve Transfers of a local asset from System Parachain to Parachain should work diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs index 430c203edd8..8d3c5358a37 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs @@ -161,7 +161,8 @@ fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> Dispa ) } -/// Limited Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work +/// Limited Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't +/// work #[test] fn limited_reserve_transfer_native_asset_from_relay_to_system_para_fails() { // Init values for Relay Chain @@ -299,14 +300,16 @@ fn limited_reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; test.set_assertion::(system_para_to_para_assertions); - // TODO: Add assertion for Penpal runtime. Right now message is failing with `UntrustedReserveLocation` + // TODO: Add assertion for Penpal runtime. Right now message is failing with + // `UntrustedReserveLocation` test.set_dispatchable::(system_para_to_para_limited_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); - // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve transfers + // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve + // transfers } /// Reserve Transfers of native asset from System Parachain to Parachain should work @@ -329,14 +332,16 @@ fn reserve_transfer_native_asset_from_system_para_to_para() { let sender_balance_before = test.sender.balance; test.set_assertion::(system_para_to_para_assertions); - // TODO: Add assertion for Penpal runtime. Right now message is failing with `UntrustedReserveLocation` + // TODO: Add assertion for Penpal runtime. Right now message is failing with + // `UntrustedReserveLocation` test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); test.assert(); let sender_balance_after = test.sender.balance; assert_eq!(sender_balance_before - amount_to_send, sender_balance_after); - // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve transfers + // TODO: Check receiver balance when Penpal runtime is improved to propery handle reserve + // transfers } /// Limited Reserve Transfers of a local asset from System Parachain to Parachain should work diff --git a/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs index 2cba64dcb9c..af3f4103abe 100644 --- a/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs @@ -112,8 +112,10 @@ pub type ForeignAssetsConvertedConcreteId = assets_common::ForeignAssetsConverte // Ignore `TrustBackedAssets` explicitly StartsWith, // Ignore assets that start explicitly with our `GlobalConsensus(NetworkId)`, means: - // - foreign assets from our consensus should be: `MultiLocation {parents: 1, X*(Parachain(xyz), ..)}` - // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` won't be accepted here + // - foreign assets from our consensus should be: `MultiLocation {parents: 1, + // X*(Parachain(xyz), ..)}` + // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` won't + // be accepted here StartsWithExplicitGlobalConsensus, ), Balance, @@ -355,7 +357,8 @@ pub type Barrier = TrailingSetTopicAsId< // Allow XCMs with some computed origins to pass through. WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, // Parent and its pluralities (i.e. governance bodies) get free execution. AllowExplicitUnpaidExecutionFrom, @@ -455,7 +458,8 @@ impl pallet_xcm::Config for Runtime { type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed. + // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are + // allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; diff --git a/parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs b/parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs index 50bc2768b57..bcf20cb5810 100644 --- a/parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/tests/tests.rs @@ -183,7 +183,8 @@ fn test_asset_xcm_trader_with_refund() { assert_ok!(trader.buy_weight(bought, asset.clone().into(), &ctx)); // Make sure again buy_weight does return an error - // This assert relies on the fact, that we use `TakeFirstAssetTrader` in `WeightTrader` tuple chain, which cannot be called twice + // This assert relies on the fact, that we use `TakeFirstAssetTrader` in `WeightTrader` + // tuple chain, which cannot be called twice assert_noop!(trader.buy_weight(bought, asset.into(), &ctx), XcmError::TooExpensive); // We actually use half of the weight diff --git a/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs index 0681ec3de0d..d1fad6940ec 100644 --- a/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs @@ -113,8 +113,10 @@ pub type ForeignAssetsConvertedConcreteId = assets_common::ForeignAssetsConverte // Ignore `TrustBackedAssets` explicitly StartsWith, // Ignore assets that start explicitly with our `GlobalConsensus(NetworkId)`, means: - // - foreign assets from our consensus should be: `MultiLocation {parents: 1, X*(Parachain(xyz), ..)}` - // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` won't be accepted here + // - foreign assets from our consensus should be: `MultiLocation {parents: 1, + // X*(Parachain(xyz), ..)}` + // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` won't + // be accepted here StartsWithExplicitGlobalConsensus, ), Balance, @@ -466,7 +468,8 @@ impl pallet_xcm::Config for Runtime { type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed. + // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are + // allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; diff --git a/parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs b/parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs index 158f30168e3..0d4f9ed8295 100644 --- a/parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/tests/tests.rs @@ -190,7 +190,8 @@ fn test_asset_xcm_trader_with_refund() { assert_ok!(trader.buy_weight(bought, asset.clone().into(), &ctx)); // Make sure again buy_weight does return an error - // This assert relies on the fact, that we use `TakeFirstAssetTrader` in `WeightTrader` tuple chain, which cannot be called twice + // This assert relies on the fact, that we use `TakeFirstAssetTrader` in `WeightTrader` + // tuple chain, which cannot be called twice assert_noop!(trader.buy_weight(bought, asset.into(), &ctx), XcmError::TooExpensive); // We actually use half of the weight diff --git a/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index eeefaee3826..50dc5c3f7f2 100644 --- a/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1392,8 +1392,9 @@ pub mod migrations { use sp_runtime::{traits::StaticLookup, Saturating}; use xcm::latest::prelude::*; - /// Temporary migration because of bug with native asset, it can be removed once applied on `AssetHubWestend`. - /// Migrates pools with `MultiLocation { parents: 0, interior: Here }` to `MultiLocation { parents: 1, interior: Here }` + /// Temporary migration because of bug with native asset, it can be removed once applied on + /// `AssetHubWestend`. Migrates pools with `MultiLocation { parents: 0, interior: Here }` to + /// `MultiLocation { parents: 1, interior: Here }` pub struct NativeAssetParents0ToParents1Migration(sp_std::marker::PhantomData); impl< T: pallet_asset_conversion::Config< diff --git a/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs index e52512acfbf..d6171195032 100644 --- a/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs @@ -118,8 +118,10 @@ pub type ForeignAssetsConvertedConcreteId = assets_common::ForeignAssetsConverte // Ignore `TrustBackedAssets` explicitly StartsWith, // Ignore asset which starts explicitly with our `GlobalConsensus(NetworkId)`, means: - // - foreign assets from our consensus should be: `MultiLocation {parents: 1, X*(Parachain(xyz), ..)} - // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` wont be accepted here + // - foreign assets from our consensus should be: `MultiLocation {parents: 1, + // X*(Parachain(xyz), ..)} + // - foreign assets outside our consensus with the same `GlobalConsensus(NetworkId)` wont + // be accepted here StartsWithExplicitGlobalConsensus, ), Balance, @@ -417,7 +419,8 @@ pub type Barrier = TrailingSetTopicAsId< // Allow XCMs with some computed origins to pass through. WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, // Parent and its pluralities (i.e. governance bodies) get free execution. AllowExplicitUnpaidExecutionFrom, diff --git a/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs b/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs index 05d425677de..e3bd45c5711 100644 --- a/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs @@ -193,7 +193,8 @@ fn test_asset_xcm_trader_with_refund() { assert_ok!(trader.buy_weight(bought, asset.clone().into(), &ctx)); // Make sure again buy_weight does return an error - // This assert relies on the fact, that we use `TakeFirstAssetTrader` in `WeightTrader` tuple chain, which cannot be called twice + // This assert relies on the fact, that we use `TakeFirstAssetTrader` in `WeightTrader` + // tuple chain, which cannot be called twice assert_noop!(trader.buy_weight(bought, asset.into(), &ctx), XcmError::TooExpensive); // We actually use half of the weight diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index 72eb84590f5..25ab296ff1c 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -55,7 +55,8 @@ pub type MultiLocationConvertedConcreteId = JustTry, >; -/// [`MatchedConvertedConcreteId`] converter dedicated for storing `ForeignAssets` with `AssetId` as `MultiLocation`. +/// [`MatchedConvertedConcreteId`] converter dedicated for storing `ForeignAssets` with `AssetId` as +/// `MultiLocation`. /// /// Excludes by default: /// - parent as relay chain @@ -68,7 +69,8 @@ pub type ForeignAssetsConvertedConcreteId, // Here we rely on fact that something like this works: - // assert!(MultiLocation::new(1, X1(Parachain(100))).starts_with(&MultiLocation::parent())); + // assert!(MultiLocation::new(1, + // X1(Parachain(100))).starts_with(&MultiLocation::parent())); // assert!(X1(Parachain(100)).starts_with(&Here)); StartsWith, // Here we can exclude more stuff or leave it as `()` diff --git a/parachains/runtimes/assets/test-utils/src/test_cases.rs b/parachains/runtimes/assets/test-utils/src/test_cases.rs index 375da28720e..d48b02cb49b 100644 --- a/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -273,7 +273,8 @@ macro_rules! include_teleports_for_native_asset_works( } ); -/// Test-case makes sure that `Runtime` can receive teleported assets from sibling parachain relay chain +/// Test-case makes sure that `Runtime` can receive teleported assets from sibling parachain relay +/// chain pub fn teleports_for_foreign_assets_works< Runtime, XcmConfig, @@ -595,7 +596,8 @@ macro_rules! include_teleports_for_foreign_assets_works( } ); -/// Test-case makes sure that `Runtime`'s `xcm::AssetTransactor` can handle native relay chain currency +/// Test-case makes sure that `Runtime`'s `xcm::AssetTransactor` can handle native relay chain +/// currency pub fn asset_transactor_transfer_with_local_consensus_currency_works( collator_session_keys: CollatorSessionKeys, source_account: AccountIdOf, @@ -707,7 +709,8 @@ macro_rules! include_asset_transactor_transfer_with_local_consensus_currency_wor } ); -///Test-case makes sure that `Runtime`'s `xcm::AssetTransactor` can handle native relay chain currency +///Test-case makes sure that `Runtime`'s `xcm::AssetTransactor` can handle native relay chain +/// currency pub fn asset_transactor_transfer_with_pallet_assets_instance_works< Runtime, XcmConfig, @@ -827,7 +830,8 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works< ); additional_checks_before(); - // transfer_asset (deposit/withdraw) ALICE -> CHARLIE (not ok - Charlie does not have ExistentialDeposit) + // transfer_asset (deposit/withdraw) ALICE -> CHARLIE (not ok - Charlie does not have + // ExistentialDeposit) assert_noop!( RuntimeHelper::::do_transfer( MultiLocation { @@ -1103,7 +1107,8 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor freezer: bob_account.clone().into(), }); - // lets simulate this was triggered by relay chain from local consensus sibling parachain + // lets simulate this was triggered by relay chain from local consensus sibling + // parachain let xcm = Xcm(vec![ WithdrawAsset(buy_execution_fee.clone().into()), BuyExecution { fees: buy_execution_fee.clone(), weight_limit: Unlimited }, @@ -1206,7 +1211,8 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor pallet_assets::Error::::NoPermission ); - // lets try create asset for different parachain(3333) (foreign_creator(2222) can create just his assets) + // lets try create asset for different parachain(3333) (foreign_creator(2222) can create + // just his assets) let foreign_asset_id_multilocation = MultiLocation { parents: 1, interior: X2(Parachain(3333), GeneralIndex(1234567)) }; let asset_id = AssetIdConverter::convert(&foreign_asset_id_multilocation).unwrap(); diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 4326e35de2b..1208f26c583 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -163,7 +163,8 @@ pub type Barrier = TrailingSetTopicAsId< AllowKnownQueryResponses, WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, // Parent and its pluralities (i.e. governance bodies) get free execution. AllowExplicitUnpaidExecutionFrom, diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 863191d1bc8..65265582835 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -166,9 +166,11 @@ pub type Barrier = TrailingSetTopicAsId< AllowKnownQueryResponses, WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies), and the Fellows plurality get free execution. + // Parent, its pluralities (i.e. governance bodies), and the Fellows plurality + // get free execution. AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, FellowsPlurality)>, // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index ac1f1119392..e3dd8692814 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -207,7 +207,8 @@ pub type Barrier = TrailingSetTopicAsId< AllowKnownQueryResponses, WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, // Parent and its pluralities (i.e. governance bodies) get free execution. AllowExplicitUnpaidExecutionFrom, @@ -230,8 +231,8 @@ impl xcm_executor::Config for XcmConfig { type XcmSender = XcmRouter; type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; - // BridgeHub does not recognize a reserve location for any asset. Users must teleport Native token - // where allowed (e.g. with the Relay Chain). + // BridgeHub does not recognize a reserve location for any asset. Users must teleport Native + // token where allowed (e.g. with the Relay Chain). type IsReserve = (); /// Only allow teleportation of NativeToken of relay chain. type IsTeleporter = ConcreteNativeAssetFrom; @@ -317,7 +318,8 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } -/// Hacky switch implementation, because we have just one runtime for Rococo and Wococo BridgeHub, so it means we have just one XcmConfig +/// Hacky switch implementation, because we have just one runtime for Rococo and Wococo BridgeHub, +/// so it means we have just one XcmConfig pub struct BridgeHubRococoOrBridgeHubWococoSwitchExporter; impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter { type Ticket = (NetworkId, (sp_std::prelude::Vec, XcmHash)); diff --git a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs index ee9d413b7a7..e928ea5c6b6 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs +++ b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs @@ -243,7 +243,8 @@ pub fn message_dispatch_routing_works< HrmpChannelOpener: frame_support::inherent::ProvideInherent< Call = cumulus_pallet_parachain_system::Call, >, - // MessageDispatcher: MessageDispatch, DispatchLevelResult = XcmBlobMessageDispatchResult, DispatchPayload = XcmAsPlainPayload>, + // MessageDispatcher: MessageDispatch, DispatchLevelResult = + // XcmBlobMessageDispatchResult, DispatchPayload = XcmAsPlainPayload>, RuntimeNetwork: Get, BridgedNetwork: Get, { @@ -839,7 +840,8 @@ pub mod test_data { ) } - /// Helper that creates InitializationData mock data, that can be used to initialize bridge GRANDPA pallet + /// Helper that creates InitializationData mock data, that can be used to initialize bridge + /// GRANDPA pallet pub fn initialization_data< Runtime: pallet_bridge_grandpa::Config, GrandpaPalletInstance: 'static, diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index fb30551b9ca..6f5b8aff8d4 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -171,43 +171,43 @@ pub mod tests { fn check_fellowship_addresses() { let fellowship_addresses = FellowshipAddresses::get(); let kusama_fellowship_ss58: [(Rank, _); 47] = [ - (6, "16SDAKg9N6kKAbhgDyxBXdHEwpwHUHs2CNEiLNGeZV55qHna"), // proof https://kusama.subscan.io/extrinsic/16832707-4 - (6, "12MrP337azmkTdfCUKe5XLnSQrbgEKqqfZ4PQC7CZTJKAWR3"), // proof https://kusama.subscan.io/extrinsic/16967809-2 + (6, "16SDAKg9N6kKAbhgDyxBXdHEwpwHUHs2CNEiLNGeZV55qHna"), /* proof https://kusama.subscan.io/extrinsic/16832707-4 */ + (6, "12MrP337azmkTdfCUKe5XLnSQrbgEKqqfZ4PQC7CZTJKAWR3"), /* proof https://kusama.subscan.io/extrinsic/16967809-2 */ (6, "FFFF3gBSSDFSvK2HBq4qgLH75DHqXWPHeCnR1BSksAMacBs"), (5, "G7YVCdxZb8JLpAm9WMnJdNuojNT84AzU62zmvx5P1FMNtg2"), - (5, "15G1iXDLgFyfnJ51FKq1ts44TduMyUtekvzQi9my4hgYt2hs"), // proof https://kusama.subscan.io/extrinsic/16917610-2 + (5, "15G1iXDLgFyfnJ51FKq1ts44TduMyUtekvzQi9my4hgYt2hs"), /* proof https://kusama.subscan.io/extrinsic/16917610-2 */ (5, "Dcm1BqR4N7nHuV43TXdET7pNibt1Nzm42FggPHpxKRven53"), - (5, "1363HWTPzDrzAQ6ChFiMU6mP4b6jmQid2ae55JQcKtZnpLGv"), // proof https://kusama.subscan.io/extrinsic/16961180-2 + (5, "1363HWTPzDrzAQ6ChFiMU6mP4b6jmQid2ae55JQcKtZnpLGv"), /* proof https://kusama.subscan.io/extrinsic/16961180-2 */ (4, "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"), - (4, "1eTPAR2TuqLyidmPT9rMmuycHVm9s9czu78sePqg2KHMDrE"), // proof https://kusama.subscan.io/extrinsic/16921712-3 - (4, "14DsLzVyTUTDMm2eP3czwPbH53KgqnQRp3CJJZS9GR7yxGDP"), // proof https://kusama.subscan.io/extrinsic/16917519-2 - (3, "13aYUFHB3umoPoxBEAHSv451iR3RpsNi3t5yBZjX2trCtTp6"), // proof https://kusama.subscan.io/extrinsic/16917832-3 + (4, "1eTPAR2TuqLyidmPT9rMmuycHVm9s9czu78sePqg2KHMDrE"), /* proof https://kusama.subscan.io/extrinsic/16921712-3 */ + (4, "14DsLzVyTUTDMm2eP3czwPbH53KgqnQRp3CJJZS9GR7yxGDP"), /* proof https://kusama.subscan.io/extrinsic/16917519-2 */ + (3, "13aYUFHB3umoPoxBEAHSv451iR3RpsNi3t5yBZjX2trCtTp6"), /* proof https://kusama.subscan.io/extrinsic/16917832-3 */ (3, "H25aCspunTUqAt4D1gC776vKZ8FX3MvQJ3Jde6qDXPQaFxk"), (3, "GtLQoW4ZqcjExMPq6qB22bYc6NaX1yMzRuGWpSRiHqnzRb9"), - (3, "15db5ksZgmhWE9U8MDq4wLKUdFivLVBybztWV8nmaJvv3NU1"), // proof https://kusama.subscan.io/extrinsic/16876631-2 + (3, "15db5ksZgmhWE9U8MDq4wLKUdFivLVBybztWV8nmaJvv3NU1"), /* proof https://kusama.subscan.io/extrinsic/16876631-2 */ (3, "HfFpz4QUxfbocHudf8UU7cMgHqkHpf855Me5X846PZAsAYE"), - (3, "14ShUZUYUR35RBZW6uVVt1zXDxmSQddkeDdXf1JkMA6P721N"), // proof https://kusama.subscan.io/extrinsic/16918890-8 - (3, "12YzxR5TvGzfMVZNnhAJ5Hwi5zExpRWMKv2MuMwZTrddvgoi"), // proof https://kusama.subscan.io/extrinsic/16924324-3 + (3, "14ShUZUYUR35RBZW6uVVt1zXDxmSQddkeDdXf1JkMA6P721N"), /* proof https://kusama.subscan.io/extrinsic/16918890-8 */ + (3, "12YzxR5TvGzfMVZNnhAJ5Hwi5zExpRWMKv2MuMwZTrddvgoi"), /* proof https://kusama.subscan.io/extrinsic/16924324-3 */ (2, "Ddb9puChKMHq4gM6o47E551wAmaNeu6kHngX1jzNNqAw782"), - (2, "15DCWHQknBjc5YPFoVj8Pn2KoqrqYywJJ95BYNYJ4Fj3NLqz"), // proof https://kusama.subscan.io/extrinsic/16834952-2 - (2, "14ajTQdrtCA8wZmC4PgD8Y1B2Gy8L4Z3oi2fodxq9FehcFrM"), // proof https://kusama.subscan.io/extrinsic/16944257-2 + (2, "15DCWHQknBjc5YPFoVj8Pn2KoqrqYywJJ95BYNYJ4Fj3NLqz"), /* proof https://kusama.subscan.io/extrinsic/16834952-2 */ + (2, "14ajTQdrtCA8wZmC4PgD8Y1B2Gy8L4Z3oi2fodxq9FehcFrM"), /* proof https://kusama.subscan.io/extrinsic/16944257-2 */ (2, "HxhDbS3grLurk1dhDgPiuDaRowHY1xHCU8Vu8on3fdg85tx"), (2, "HTk3eccL7WBkiyxz1gBcqQRghsJigoDMD7mnQaz1UAbMpQV"), (2, "EcNWrSPSDcVBRymwr26kk4JVFg92PdoU5Xwp87W2FgFSt9c"), (2, "D8sM6vKjWaeKy2zCPYWGkLLbWdUtWQrXBTQqr4dSYnVQo21"), (1, "GfbnnEgRU94n9ed4RFZ6Z9dBAWs5obykigJSwXKU9hsT2uU"), (1, "HA5NtttvyZsxo4wGxGoJJSMaWtdEFZAuGUMFHVWD7fgenPv"), - (1, "14mDeKZ7qp9hqBjjDg51c8BFrf9o69om8piSSRwj2fT5Yb1i"), // proof https://kusama.subscan.io/extrinsic/16919020-4 - (1, "16a357f5Sxab3V2ne4emGQvqJaCLeYpTMx3TCjnQhmJQ71DX"), // proof https://kusama.subscan.io/extrinsic/16836396-5 - (1, "14Ak9rrF6RKHHoLLRUYMnzcvvi1t8E1yAMa7tcmiwUfaqzYK"), // proof https://kusama.subscan.io/extrinsic/16921990-3 + (1, "14mDeKZ7qp9hqBjjDg51c8BFrf9o69om8piSSRwj2fT5Yb1i"), /* proof https://kusama.subscan.io/extrinsic/16919020-4 */ + (1, "16a357f5Sxab3V2ne4emGQvqJaCLeYpTMx3TCjnQhmJQ71DX"), /* proof https://kusama.subscan.io/extrinsic/16836396-5 */ + (1, "14Ak9rrF6RKHHoLLRUYMnzcvvi1t8E1yAMa7tcmiwUfaqzYK"), /* proof https://kusama.subscan.io/extrinsic/16921990-3 */ (1, "FJq9JpA9P7EXbmfsN9YiewJaDbQyL6vQyksGtJvzfbn6zf8"), - (1, "15oLanodWWweiZJSoDTEBtrX7oGfq6e8ct5y5E6fVRDPhUgj"), // proof https://kusama.subscan.io/extrinsic/16876423-7 + (1, "15oLanodWWweiZJSoDTEBtrX7oGfq6e8ct5y5E6fVRDPhUgj"), /* proof https://kusama.subscan.io/extrinsic/16876423-7 */ (1, "EaBqDJJNsZmYdQ4xn1vomPJVNh7fjA6UztZeEjn7ZzdeT7V"), (1, "HTxCvXKVvUZ7PQq175kCRRLu7XkGfTfErrdNXr1ZuuwVZWv"), (1, "HZe91A6a1xqbKaw6ofx3GFepJjhVXHrwHEwn6YUDDFphpX9"), (1, "GRy2P3kBEzSHCbmDJfquku1cyUyhZaAqojRcNE4A4U3MnLd"), (1, "HYwiBo7Mcv7uUDg4MUoKm2fxzv4dMLAtmmNfzHV8qcQJpAE"), - (1, "1ThiBx5DDxFhoD9GY6tz5Fp4Y7Xn1xfLmDddcoFQghDvvjg"), // proof https://kusama.subscan.io/extrinsic/16918130-2 + (1, "1ThiBx5DDxFhoD9GY6tz5Fp4Y7Xn1xfLmDddcoFQghDvvjg"), /* proof https://kusama.subscan.io/extrinsic/16918130-2 */ (1, "DfqY6XQUSETTszBQ1juocTcG9iiDoXhvq1CoVadBSUqTGJS"), (1, "EnpgVWGGQVrFdSB2qeXRVdtccV6U5ZscNELBoERbkFD8Wi6"), (1, "H5BuqCmucJhUUuvjAzPazeVwVCtUSXVQdc5Dnx2q5zD7rVn"), @@ -215,9 +215,9 @@ pub mod tests { (1, "CzuUtvKhZNZBjyAXeYviaRXwrLhVrsupJ9PrWmdq7BJTjGR"), (1, "FCunn2Rx8JqfT5g6noUKKazph4jLDba5rUee7o3ZmJ362Ju"), (1, "HyPMjWRHCpJS7x2SZ2R6M2XG5ZiCiZag4U4r7gBHRsE5mTc"), - (1, "1682A5hxfiS1Kn1jrUnMYv14T9EuEnsgnBbujGfYbeEbSK3w"), // proof https://kusama.subscan.io/extrinsic/16919077-2 - (1, "13xS6fK6MHjApLnjdX7TJYw1niZmiXasSN91bNtiXQjgEtNx"), // proof https://kusama.subscan.io/extrinsic/16918212-7 - (1, "15qE2YAQCs5Y962RHE7RzNjQxU6Pei21nhkkSM9Sojq1hHps"), // https://kusama.subscan.io/extrinsic/17352973-2 + (1, "1682A5hxfiS1Kn1jrUnMYv14T9EuEnsgnBbujGfYbeEbSK3w"), /* proof https://kusama.subscan.io/extrinsic/16919077-2 */ + (1, "13xS6fK6MHjApLnjdX7TJYw1niZmiXasSN91bNtiXQjgEtNx"), /* proof https://kusama.subscan.io/extrinsic/16918212-7 */ + (1, "15qE2YAQCs5Y962RHE7RzNjQxU6Pei21nhkkSM9Sojq1hHps"), /* https://kusama.subscan.io/extrinsic/17352973-2 */ ]; for (index, val) in kusama_fellowship_ss58.iter().enumerate() { diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs index 99613542a2e..489b868eff3 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -113,14 +113,16 @@ impl pallet_ranked_collective::Config for Runtime // Promotions and the induction of new members are serviced by `FellowshipCore` pallet instance. type PromoteOrigin = frame_system::EnsureNever; #[cfg(feature = "runtime-benchmarks")] - // The maximum value of `u16` set as a success value for the root to ensure the benchmarks will pass. + // The maximum value of `u16` set as a success value for the root to ensure the benchmarks will + // pass. type PromoteOrigin = EnsureRootWithSuccess>; // Demotion is by any of: // - Root can demote arbitrarily. // - the FellowshipAdmin origin (i.e. token holder referendum); // - // The maximum value of `u16` set as a success value for the root to ensure the benchmarks will pass. + // The maximum value of `u16` set as a success value for the root to ensure the benchmarks will + // pass. type DemoteOrigin = EitherOf< EnsureRootWithSuccess>, MapSuccess< diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs index d10a5273e3f..fc53efdd7e8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -68,7 +68,8 @@ impl Convert for MinRankOfClass { regular @ 1..=9 => regular, // A retention vote; the track ID turns out to be 8 more than the minimum required rank. retention @ 11..=16 => retention - 8, - // A promotion vote; the track ID turns out to be 18 more than the minimum required rank. + // A promotion vote; the track ID turns out to be 18 more than the minimum required + // rank. promotion @ 21..=26 => promotion - 18, _ => Rank::max_value(), } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs index 784f6149b81..df2bf8c168b 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/impls.rs @@ -35,7 +35,8 @@ type HashOf = ::Hash; pub type BalanceOf = as Currency<::AccountId>>::Balance; -/// Implements `OnUnbalanced::on_unbalanced` to teleport slashed assets to relay chain treasury account. +/// Implements `OnUnbalanced::on_unbalanced` to teleport slashed assets to relay chain treasury +/// account. pub struct ToParentTreasury( PhantomData<(TreasuryAccount, PalletAccount, T)>, ); @@ -187,8 +188,9 @@ pub mod benchmarks { } } - /// Type that wraps a type implementing the [`Pay`] trait to decorate its [`Pay::ensure_successful`] - /// function with a provided implementation of the [`EnsureSuccessful`] trait. + /// Type that wraps a type implementing the [`Pay`] trait to decorate its + /// [`Pay::ensure_successful`] function with a provided implementation of the + /// [`EnsureSuccessful`] trait. pub struct PayWithEnsure(PhantomData<(O, E)>); impl Pay for PayWithEnsure where diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index aff30706c46..6fb6bb240ea 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -20,15 +20,14 @@ //! //! ### Governance //! -//! As a common good parachain, Collectives defers its governance (namely, its `Root` origin), to its -//! Relay Chain parent, Polkadot. +//! As a common good parachain, Collectives defers its governance (namely, its `Root` origin), to +//! its Relay Chain parent, Polkadot. //! //! ### Collator Selection //! //! Collectives uses `pallet-collator-selection`, a simple first-come-first-served registration //! system where collators can reserve a small bond to join the block producer set. There is no //! slashing. Collective members are generally expected to run collators. -//! #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index 8a0fb8bea5b..5f1f256e6b3 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -213,7 +213,8 @@ pub type Barrier = TrailingSetTopicAsId< // Allow XCMs with some computed origins to pass through. WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, // Parent and its pluralities (i.e. governance bodies) get free execution. AllowExplicitUnpaidExecutionFrom, diff --git a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs index cc095c9229f..3857c07fd03 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs @@ -129,7 +129,8 @@ pub type Barrier = TrailingSetTopicAsId< // Allow XCMs with some computed origins to pass through. WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, // Parent and its pluralities (i.e. governance bodies) get free execution. AllowExplicitUnpaidExecutionFrom, @@ -196,7 +197,8 @@ impl pallet_xcm::Config for Runtime { type XcmRouter = XcmRouter; // We support local origins dispatching XCM executions in principle... type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed. + // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are + // allowed. type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index a8b33bfcd50..1825bea425d 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -20,7 +20,8 @@ //! //! One of the main uses of the penpal chain will be to be a benefactor of reserve asset transfers //! with Asset Hub as the reserve. At present no derivative tokens are minted on receipt of a -//! `ReserveAssetTransferDeposited` message but that will but the intension will be to support this soon. +//! `ReserveAssetTransferDeposited` message but that will but the intension will be to support this +//! soon. use super::{ AccountId, AllPalletsWithSystem, AssetId as AssetIdPalletAssets, Assets, Balance, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, @@ -159,9 +160,11 @@ pub type Barrier = TrailingSetTopicAsId< // Allow XCMs with some computed origins to pass through. WithComputedOrigin< ( - // If the message is one that immediately attemps to pay for execution, then allow it. + // If the message is one that immediately attemps to pay for execution, then + // allow it. AllowTopLevelPaidExecutionFrom, - // Common Good Assets parachain, parent and its exec plurality get free execution + // Common Good Assets parachain, parent and its exec plurality get free + // execution AllowExplicitUnpaidExecutionFrom<( CommonGoodAssetsParachain, ParentOrParentsExecutivePlurality, diff --git a/polkadot-parachain/src/service.rs b/polkadot-parachain/src/service.rs index 826fa886121..4377872bcf6 100644 --- a/polkadot-parachain/src/service.rs +++ b/polkadot-parachain/src/service.rs @@ -331,7 +331,8 @@ where /// Start a shell node with the given parachain `Configuration` and relay chain `Configuration`. /// -/// This is the actual implementation that is abstract over the executor and the runtime api for shell nodes. +/// This is the actual implementation that is abstract over the executor and the runtime api for +/// shell nodes. #[sc_tracing::logging::prefix_logs_with("Parachain")] async fn start_shell_node_impl( parachain_config: Configuration, diff --git a/primitives/core/src/lib.rs b/primitives/core/src/lib.rs index 752e1aee474..19cc69ea301 100644 --- a/primitives/core/src/lib.rs +++ b/primitives/core/src/lib.rs @@ -140,9 +140,9 @@ impl XcmpMessageSource for () { /// The "quality of service" considerations for message sending. #[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, RuntimeDebug)] pub enum ServiceQuality { - /// Ensure that this message is dispatched in the same relative order as any other messages that - /// were also sent with `Ordered`. This only guarantees message ordering on the dispatch side, - /// and not necessarily on the execution side. + /// Ensure that this message is dispatched in the same relative order as any other messages + /// that were also sent with `Ordered`. This only guarantees message ordering on the dispatch + /// side, and not necessarily on the execution side. Ordered, /// Ensure that the message is dispatched as soon as possible, which could result in it being /// dispatched before other messages which are larger and/or rely on relative ordering. @@ -269,8 +269,8 @@ pub mod rpsr_digest { DigestItem::Consensus(RPSR_CONSENSUS_ID, (storage_root, number.into()).encode()) } - /// Extract the relay-parent storage root and number from the provided header digest. Returns `None` - /// if none were found. + /// Extract the relay-parent storage root and number from the provided header digest. Returns + /// `None` if none were found. pub fn extract_relay_parent_storage_root( digest: &Digest, ) -> Option<(relay_chain::Hash, relay_chain::BlockNumber)> { @@ -299,7 +299,8 @@ pub struct CollationInfoV1 { pub new_validation_code: Option, /// 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: relay_chain::BlockNumber, } @@ -328,7 +329,8 @@ pub struct CollationInfo { pub new_validation_code: Option, /// 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: relay_chain::BlockNumber, /// The head data, aka encoded header, of the block that corresponds to the collation. pub head_data: HeadData, diff --git a/primitives/parachain-inherent/src/client_side.rs b/primitives/parachain-inherent/src/client_side.rs index 03ca3203dc0..f93340e3718 100644 --- a/primitives/parachain-inherent/src/client_side.rs +++ b/primitives/parachain-inherent/src/client_side.rs @@ -100,7 +100,8 @@ async fn collect_relay_storage_proof( relay_well_known_keys::ACTIVE_CONFIG.to_vec(), relay_well_known_keys::dmq_mqc_head(para_id), // TODO paritytech/polkadot#6283: Remove all usages of `relay_dispatch_queue_size` - // We need to keep this here until all parachains have migrated to `relay_dispatch_queue_remaining_capacity`. + // We need to keep this here until all parachains have migrated to + // `relay_dispatch_queue_remaining_capacity`. #[allow(deprecated)] relay_well_known_keys::relay_dispatch_queue_size(para_id), relay_well_known_keys::relay_dispatch_queue_remaining_capacity(para_id).key, diff --git a/primitives/parachain-inherent/src/lib.rs b/primitives/parachain-inherent/src/lib.rs index 4781f5e7081..34b9064090c 100644 --- a/primitives/parachain-inherent/src/lib.rs +++ b/primitives/parachain-inherent/src/lib.rs @@ -16,11 +16,11 @@ //! Cumulus parachain inherent //! -//! The [`ParachainInherentData`] is the data that is passed by the collator to the parachain runtime. -//! The runtime will use this data to execute messages from other parachains/the relay chain or to -//! read data from the relay chain state. When the parachain is validated by a parachain validator on -//! the relay chain, this data is checked for correctnes. If the data passed by the collator to the -//! runtime isn't correct, the parachain candidate is considered invalid. +//! The [`ParachainInherentData`] is the data that is passed by the collator to the parachain +//! runtime. The runtime will use this data to execute messages from other parachains/the relay +//! chain or to read data from the relay chain state. When the parachain is validated by a parachain +//! validator on the relay chain, this data is checked for correctnes. If the data passed by the +//! collator to the runtime isn't correct, the parachain candidate is considered invalid. //! //! Use [`ParachainInherentData::create_at`] to create the [`ParachainInherentData`] at a given //! relay chain block to include it in a parachain block. diff --git a/primitives/parachain-inherent/src/mock.rs b/primitives/parachain-inherent/src/mock.rs index 00dff40800f..18e23ba23af 100644 --- a/primitives/parachain-inherent/src/mock.rs +++ b/primitives/parachain-inherent/src/mock.rs @@ -93,7 +93,8 @@ pub struct MockXcmConfig { /// The name of the parachain system in the runtime. /// -/// This name is used by frame to prefix storage items and will be required to read data from the storage. +/// This name is used by frame to prefix storage items and will be required to read data from the +/// storage. /// /// The `Default` implementation sets the name to `ParachainSystem`. pub struct ParachainSystemName(pub Vec); diff --git a/primitives/timestamp/src/lib.rs b/primitives/timestamp/src/lib.rs index 932656d9b0f..4c28a169a27 100644 --- a/primitives/timestamp/src/lib.rs +++ b/primitives/timestamp/src/lib.rs @@ -16,14 +16,14 @@ //! Cumulus timestamp related primitives. //! -//! Provides a [`InherentDataProvider`] that should be used in the validation phase of the parachain. -//! It will be used to create the inherent data and that will be used to check the inherents inside -//! the parachain block (in this case the timestamp inherent). As we don't have access to any clock -//! from the runtime the timestamp is always passed as an inherent into the runtime. To check this -//! inherent when validating the block, we will use the relay chain slot. As the relay chain slot -//! is derived from a timestamp, we can easily convert it back to a timestamp by muliplying it with -//! the slot duration. By comparing the relay chain slot derived timestamp with the timestamp we can -//! ensure that the parachain timestamp is reasonable. +//! Provides a [`InherentDataProvider`] that should be used in the validation phase of the +//! parachain. It will be used to create the inherent data and that will be used to check the +//! inherents inside the parachain block (in this case the timestamp inherent). As we don't have +//! access to any clock from the runtime the timestamp is always passed as an inherent into the +//! runtime. To check this inherent when validating the block, we will use the relay chain slot. As +//! the relay chain slot is derived from a timestamp, we can easily convert it back to a timestamp +//! by muliplying it with the slot duration. By comparing the relay chain slot derived timestamp +//! with the timestamp we can ensure that the parachain timestamp is reasonable. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/primitives/utility/src/lib.rs b/primitives/utility/src/lib.rs index 10d0604fcd1..87be029163d 100644 --- a/primitives/utility/src/lib.rs +++ b/primitives/utility/src/lib.rs @@ -234,7 +234,8 @@ impl< outstanding_minus_substracted.saturated_into(); let asset_balance: u128 = asset_balance.saturated_into(); - // Construct outstanding_concrete_asset with the same location id and substracted balance + // Construct outstanding_concrete_asset with the same location id and substracted + // balance let outstanding_concrete_asset: MultiAsset = (id, outstanding_minus_substracted).into(); // Substract from existing weight and balance @@ -271,8 +272,8 @@ impl< } /// XCM fee depositor to which we implement the TakeRevenue trait -/// It receives a Transact implemented argument, a 32 byte convertible acocuntId, and the fee receiver account -/// FungiblesMutateAdapter should be identical to that implemented by WithdrawAsset +/// It receives a Transact implemented argument, a 32 byte convertible acocuntId, and the fee +/// receiver account FungiblesMutateAdapter should be identical to that implemented by WithdrawAsset pub struct XcmFeesTo32ByteAccount( PhantomData<(FungiblesMutateAdapter, AccountId, ReceiverAccount)>, ); diff --git a/test/client/src/block_builder.rs b/test/client/src/block_builder.rs index 0c0c5c4e9c7..06c7416be67 100644 --- a/test/client/src/block_builder.rs +++ b/test/client/src/block_builder.rs @@ -150,7 +150,8 @@ impl InitBlockBuilder for Client { /// Extension trait for the [`BlockBuilder`](sc_block_builder::BlockBuilder) to build directly a /// [`ParachainBlockData`]. pub trait BuildParachainBlockData { - /// Directly build the [`ParachainBlockData`] from the block that comes out of the block builder. + /// Directly build the [`ParachainBlockData`] from the block that comes out of the block + /// builder. fn build_parachain_block(self, parent_state_root: Hash) -> ParachainBlockData; } diff --git a/test/relay-sproof-builder/src/lib.rs b/test/relay-sproof-builder/src/lib.rs index a9c9edd9b44..bcd02f791f8 100644 --- a/test/relay-sproof-builder/src/lib.rs +++ b/test/relay-sproof-builder/src/lib.rs @@ -78,7 +78,8 @@ impl Default for RelayStateSproofBuilder { } impl RelayStateSproofBuilder { - /// Returns a mutable reference to HRMP channel metadata for a channel (`sender`, `self.para_id`). + /// Returns a mutable reference to HRMP channel metadata for a channel (`sender`, + /// `self.para_id`). /// /// If there is no channel, a new default one is created. /// diff --git a/test/relay-validation-worker-provider/build.rs b/test/relay-validation-worker-provider/build.rs index 9b5247bcbe5..599b1b73b48 100644 --- a/test/relay-validation-worker-provider/build.rs +++ b/test/relay-validation-worker-provider/build.rs @@ -154,7 +154,8 @@ fn build_project(cargo_toml: &Path) { .arg("build") .arg("--release") .arg(format!("--manifest-path={}", cargo_toml.display())) - // Unset the `CARGO_TARGET_DIR` to prevent a cargo deadlock (cargo locks a target dir exclusive). + // Unset the `CARGO_TARGET_DIR` to prevent a cargo deadlock (cargo locks a target dir + // exclusive). .env_remove("CARGO_TARGET_DIR") // Do not call us recursively. .env(SKIP_ENV, "1") diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index 7e2fd9695fd..64867b082a8 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -81,8 +81,8 @@ impl_opaque_keys! { pub const TEST_RUNTIME_UPGRADE_KEY: &[u8] = b"+test_runtime_upgrade_key+"; // The only difference between the two declarations below is the `spec_version`. With the -// `increment-spec-version` feature enabled `spec_version` should be greater than the one of without the -// `increment-spec-version` feature. +// `increment-spec-version` feature enabled `spec_version` should be greater than the one of without +// the `increment-spec-version` feature. // // The duplication here is unfortunate necessity. // diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index 665f0a735ed..64e1dd8ceca 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -473,8 +473,8 @@ pub struct TestNode { pub client: Arc, /// Node's network. pub network: Arc>, - /// 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, @@ -512,7 +512,8 @@ impl TestNodeBuilder { /// /// `para_id` - The parachain id this node is running for. /// `tokio_handle` - The tokio handler to use. - /// `key` - The key that will be used to generate the name and that will be passed as `dev_seed`. + /// `key` - The key that will be used to generate the name and that will be passed as + /// `dev_seed`. pub fn new(para_id: ParaId, tokio_handle: tokio::runtime::Handle, key: Sr25519Keyring) -> Self { TestNodeBuilder { key, diff --git a/xcm/xcm-emulator/src/lib.rs b/xcm/xcm-emulator/src/lib.rs index f881cdd1fca..a82b51948bc 100644 --- a/xcm/xcm-emulator/src/lib.rs +++ b/xcm/xcm-emulator/src/lib.rs @@ -1301,8 +1301,9 @@ pub struct TestContext { /// These arguments can be easily reused and shared between the assertions functions /// and dispatchables functions, which are also stored in `Test`. /// `Origin` corresponds to the chain where the XCM interaction starts with an initial execution. -/// `Destination` corresponds to the last chain where an effect of the intial execution is expected happen. -/// `Hops` refer all the ordered intermediary chains an initial XCM execution can provoke some effect. +/// `Destination` corresponds to the last chain where an effect of the intial execution is expected +/// happen. `Hops` refer all the ordered intermediary chains an initial XCM execution can provoke +/// some effect. #[derive(Clone)] pub struct Test where