From 123f8f4a30881102ca3ee4a4a135e4fd0870df60 Mon Sep 17 00:00:00 2001 From: Andrei Eres Date: Thu, 17 Oct 2024 23:07:33 +0200 Subject: [PATCH] Update Rust version (#473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #470 - Fixed formatting - Doc comments were split making first doc comment not too long - Fixed lists in doc comments - Unreachable patterns silenced with `#[allow(unreachable_patterns)]` (controversial) - `time` updated to 0.3.36 - [x] Does not require a CHANGELOG entry --------- Co-authored-by: Bastian Köcher Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com> --- .github/env | 6 ++--- .../asset-hub-kusama/src/tests/teleport.rs | 4 ++- .../asset-hub-polkadot/src/tests/teleport.rs | 4 ++- .../people-kusama/src/tests/teleport.rs | 4 ++- .../people-polkadot/src/tests/teleport.rs | 4 ++- relay/kusama/src/governance/origins.rs | 1 + relay/kusama/src/lib.rs | 18 +++++++------ relay/polkadot/src/governance/origins.rs | 1 + relay/polkadot/src/lib.rs | 26 ++++++++++--------- .../asset-hubs/asset-hub-kusama/src/lib.rs | 13 ++++++---- .../asset-hub-kusama/src/xcm_config.rs | 15 ++++++----- .../asset-hubs/asset-hub-polkadot/src/lib.rs | 13 ++++++---- .../asset-hub-polkadot/src/xcm_config.rs | 15 ++++++----- .../bridge-hub-kusama/src/xcm_config.rs | 12 +++++---- .../bridge-hub-polkadot/src/xcm_config.rs | 13 ++++++---- .../src/ambassador/mod.rs | 18 ++++++------- .../src/ambassador/origins.rs | 1 + .../src/fellowship/origins.rs | 5 +++- .../collectives-polkadot/src/lib.rs | 4 ++- .../collectives-polkadot/src/xcm_config.rs | 12 +++++---- system-parachains/constants/src/lib.rs | 7 ++--- .../coretime-kusama/src/xcm_config.rs | 12 +++++---- .../coretime/coretime-polkadot/src/lib.rs | 7 ++--- .../coretime-polkadot/src/xcm_config.rs | 12 +++++---- system-parachains/encointer/src/lib.rs | 7 ++--- system-parachains/encointer/src/xcm_config.rs | 12 +++++---- .../gluttons/glutton-kusama/src/xcm_config.rs | 5 ++-- .../people/people-kusama/src/lib.rs | 7 ++--- .../people/people-kusama/src/xcm_config.rs | 12 +++++---- .../people/people-polkadot/src/xcm_config.rs | 12 +++++---- 30 files changed, 168 insertions(+), 114 deletions(-) diff --git a/.github/env b/.github/env index 6ff0ec8a9b..14bcafb097 100644 --- a/.github/env +++ b/.github/env @@ -1,3 +1,3 @@ -RUST_STABLE_VERSION=1.77.0 -RUST_NIGHTLY_VERSION=2024-04-14 -TAPLO_VERSION=0.8.1 +RUST_STABLE_VERSION=1.81.0 +RUST_NIGHTLY_VERSION=2024-09-11 +TAPLO_VERSION=0.9.3 diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs index fefae99ab6..d6ffc5472c 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs @@ -273,7 +273,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() { let delivery_fees = AssetHubKusama::execute_with(|| { xcm_helpers::teleport_assets_delivery_fees::< ::XcmSender, - >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) + >( + test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest + ) }); // Sender's balance is reduced diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs index 882543cc1b..5037a4379f 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -272,7 +272,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() { let delivery_fees = AssetHubPolkadot::execute_with(|| { xcm_helpers::teleport_assets_delivery_fees::< ::XcmSender, - >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) + >( + test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest + ) }); // Sender's balance is reduced diff --git a/integration-tests/emulated/tests/people/people-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/people/people-kusama/src/tests/teleport.rs index 7bcf0fdedd..279473dd3f 100644 --- a/integration-tests/emulated/tests/people/people-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/people/people-kusama/src/tests/teleport.rs @@ -122,7 +122,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() { let delivery_fees = PeopleKusama::execute_with(|| { xcm_helpers::teleport_assets_delivery_fees::< ::XcmSender, - >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) + >( + test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest + ) }); // Sender's balance is reduced diff --git a/integration-tests/emulated/tests/people/people-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/people/people-polkadot/src/tests/teleport.rs index c10d8c777f..4d994d648d 100644 --- a/integration-tests/emulated/tests/people/people-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/people/people-polkadot/src/tests/teleport.rs @@ -122,7 +122,9 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() { let delivery_fees = PeoplePolkadot::execute_with(|| { xcm_helpers::teleport_assets_delivery_fees::< ::XcmSender, - >(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest) + >( + test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest + ) }); // Sender's balance is reduced diff --git a/relay/kusama/src/governance/origins.rs b/relay/kusama/src/governance/origins.rs index 24dcf17801..a8ef1bc86c 100644 --- a/relay/kusama/src/governance/origins.rs +++ b/relay/kusama/src/governance/origins.rs @@ -18,6 +18,7 @@ pub use pallet_custom_origins::*; +#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_custom_origins { use crate::{Balance, GRAND, QUID}; diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 13d0bfbbda..a29936ec5e 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -1213,7 +1213,8 @@ impl InstanceFilter for ProxyType { matches!( c, RuntimeCall::Staking(..) | - RuntimeCall::Session(..) | RuntimeCall::Utility(..) | + RuntimeCall::Session(..) | + RuntimeCall::Utility(..) | RuntimeCall::FastUnstake(..) | RuntimeCall::VoterList(..) | RuntimeCall::NominationPools(..) @@ -1617,8 +1618,10 @@ impl pallet_nomination_pools::Config for Runtime { } /// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the -/// `AssetRate` pallet instance, with additional decoration to identify different IDs/locations of -/// native asset and provide a one-to-one balance conversion for them. +/// `AssetRate` pallet instance. +/// +/// With additional decoration to identify different IDs/locations of native asset and provide a +/// one-to-one balance conversion for them. pub type AssetRateWithNative = UnityOrOuterConversion< ContainsLocationParts< FromContains< @@ -1828,10 +1831,10 @@ pub mod migrations { /// /// It consists of: /// * Call into `pallet_staking::Pallet::::restore_ledger` with: -/// * Root origin; -/// * Default `None` paramters. +/// * Root origin; +/// * Default `None` paramters. /// * Forces unstake of recovered ledger if the final restored ledger has higher stake than the -/// stash's free balance. +/// stash's free balance. /// /// The stashes associated with corrupted ledgers that will be "migrated" are set in /// [`CorruptedStashes`]. @@ -1914,14 +1917,13 @@ pub(crate) mod restore_corrupted_ledgers { stash_account.clone(), slashing_spans, ) - .map_err(|err| { + .inspect_err(|err| { log::error!( target: LOG_TARGET, "migrations::corrupted_ledgers: error force unstaking ledger, unexpected. {:?}", err ); err_migration += 1; - err }); log::info!( diff --git a/relay/polkadot/src/governance/origins.rs b/relay/polkadot/src/governance/origins.rs index f1283b551e..b71466c208 100644 --- a/relay/polkadot/src/governance/origins.rs +++ b/relay/polkadot/src/governance/origins.rs @@ -18,6 +18,7 @@ pub use pallet_custom_origins::*; +#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_custom_origins { use crate::{Balance, DOLLARS, GRAND}; diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 2ee7fdd5c7..9e6064e5c7 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -1175,7 +1175,8 @@ impl InstanceFilter for ProxyType { matches!( c, RuntimeCall::Staking(..) | - RuntimeCall::Session(..) | RuntimeCall::Utility(..) | + RuntimeCall::Session(..) | + RuntimeCall::Utility(..) | RuntimeCall::FastUnstake(..) | RuntimeCall::VoterList(..) | RuntimeCall::NominationPools(..) @@ -1573,8 +1574,10 @@ impl pallet_state_trie_migration::Config for Runtime { } /// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the -/// `AssetRate` pallet instance, with additional decoration to identify different IDs/locations of -/// native asset and provide a one-to-one balance conversion for them. +/// `AssetRate` pallet instance. +/// +/// With additional decoration to identify different IDs/locations of native asset and provide a +/// one-to-one balance conversion for them. pub type AssetRateWithNative = UnityOrOuterConversion< ContainsLocationParts< FromContains< @@ -1997,10 +2000,10 @@ pub mod migrations { /// /// Safety: /// - /// - After coretime is launched, there are no auctions anymore. So if this forgotten to - /// be removed after the runtime upgrade, running this again on the next one is harmless. - /// - I am assuming scheduler `TaskName`s are unique, so removal of the scheduled entry - /// multiple times should also be fine. + /// - After coretime is launched, there are no auctions anymore. So if this forgotten to be + /// removed after the runtime upgrade, running this again on the next one is harmless. + /// - I am assuming scheduler `TaskName`s are unique, so removal of the scheduled entry multiple + /// times should also be fine. pub struct CancelAuctions; impl OnRuntimeUpgrade for CancelAuctions { fn on_runtime_upgrade() -> Weight { @@ -2059,10 +2062,10 @@ pub mod migrations { /// /// It consists of: /// * Call into `pallet_staking::Pallet::::restore_ledger` with: -/// * Root origin; -/// * Default `None` paramters. +/// * Root origin; +/// * Default `None` paramters. /// * Forces unstake of recovered ledger if the final restored ledger has higher stake than the -/// stash's free balance. +/// stash's free balance. /// /// The stashes associated with corrupted ledgers that will be "migrated" are set in /// [`CorruptedStashes`]. @@ -2147,14 +2150,13 @@ pub(crate) mod restore_corrupted_ledgers { stash_account.clone(), slashing_spans, ) - .map_err(|err| { + .inspect_err(|err| { log::error!( target: LOG_TARGET, "migrations::corrupted_ledgers: error force unstaking ledger, unexpected. {:?}", err ); err_migration += 1; - err }); log::info!( diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 141b693afe..2e37a24db9 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -431,10 +431,12 @@ parameter_types! { pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get(); } -/// Assets managed by some foreign location. Note: we do not declare a `ForeignAssetsCall` type, as -/// this type is used in proxy definitions. We assume that a foreign location would not want to set -/// an individual, local account as a proxy for the issuance of their assets. This issuance should -/// be managed by the foreign location's governance. +/// Assets managed by some foreign location. +/// +/// Note: we do not declare a `ForeignAssetsCall` type, as this type is used in proxy definitions. +/// We assume that a foreign location would not want to set an individual, local account as a proxy +/// for the issuance of their assets. This issuance should be managed by the foreign location's +/// governance. pub type ForeignAssetsInstance = pallet_assets::Instance2; impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -568,7 +570,8 @@ impl InstanceFilter for ProxyType { RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } | RuntimeCall::NftFractionalization { .. } | - RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. } + RuntimeCall::Nfts { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs index 2da556f7ce..5a7d089e1e 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs @@ -86,9 +86,10 @@ parameter_types! { .unwrap_or(TreasuryAccount::get()); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -199,8 +200,9 @@ pub type AssetTransactors = (FungibleTransactor, FungiblesTransactor, ForeignFungiblesTransactor, PoolFungiblesTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for @@ -603,7 +605,8 @@ pub mod bridging { } } impl, OriginLocation: Get> - ContainsPair for RemoteAssetFromLocation + ContainsPair + for RemoteAssetFromLocation { fn contains(asset: &Asset, origin: &Location) -> bool { >::contains(&asset.id.0, origin) diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 87bcd43d17..2a8764ee48 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -352,10 +352,12 @@ parameter_types! { pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get(); } -/// Assets managed by some foreign location. Note: we do not declare a `ForeignAssetsCall` type, as -/// this type is used in proxy definitions. We assume that a foreign location would not want to set -/// an individual, local account as a proxy for the issuance of their assets. This issuance should -/// be managed by the foreign location's governance. +/// Assets managed by some foreign location. +/// +/// Note: we do not declare a `ForeignAssetsCall` type, as this type is used in proxy definitions. +/// We assume that a foreign location would not want to set an individual, local account as a proxy +/// for the issuance of their assets. This issuance should be managed by the foreign location's +/// governance. pub type ForeignAssetsInstance = pallet_assets::Instance2; impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -492,7 +494,8 @@ impl InstanceFilter for ProxyType { RuntimeCall::Assets { .. } | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } | - RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. } + RuntimeCall::Nfts { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs index c127a0f17c..2873ac3d12 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs @@ -86,9 +86,10 @@ parameter_types! { .unwrap_or(TreasuryAccount::get()); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -199,8 +200,9 @@ pub type AssetTransactors = (FungibleTransactor, FungiblesTransactor, ForeignFungiblesTransactor, PoolFungiblesTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for @@ -671,7 +673,8 @@ pub mod bridging { } } impl, OriginLocation: Get> - ContainsPair for RemoteAssetFromLocation + ContainsPair + for RemoteAssetFromLocation { fn contains(asset: &Asset, origin: &Location) -> bool { >::contains(&asset.id.0, origin) diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index c02b8fe1ee..2a16b42aed 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -66,9 +66,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -95,8 +96,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 352d14c578..c56990f7ed 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -73,9 +73,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -102,8 +103,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for @@ -301,6 +303,7 @@ impl cumulus_pallet_xcm::Config for Runtime { } /// A `FeeManager` implementation that forces fees for any message delivered to Ethereum. +/// /// Otherwise, it permits the specified `WaivedLocations` to not pay for fees and uses the provided /// `HandleFee` implementation. pub struct XcmFeeManagerFromComponentsBridgeHub( diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs index 034206c542..6096c2ef27 100644 --- a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs @@ -17,15 +17,15 @@ //! //! The module defines the following on-chain functionality of the Ambassador Program: //! -//! - Managed set of program members, where every member has a [rank](ranks) -//! (via [AmbassadorCollective](pallet_ranked_collective)). -//! - Referendum functionality for the program members to propose, vote on, and execute -//! proposals on behalf of the members of a certain [rank](Origin) -//! (via [AmbassadorReferenda](pallet_referenda)). -//! - Promotion and demotion periods, register of members' activity, and rank based salaries -//! (via [AmbassadorCore](pallet_core_fellowship)). -//! - Members' salaries (via [AmbassadorSalary](pallet_salary), requiring a member to be -//! imported or inducted into [AmbassadorCore](pallet_core_fellowship)). +//! - Managed set of program members, where every member has a [rank](ranks) (via +//! [AmbassadorCollective](pallet_ranked_collective)). +//! - Referendum functionality for the program members to propose, vote on, and execute proposals on +//! behalf of the members of a certain [rank](Origin) (via +//! [AmbassadorReferenda](pallet_referenda)). +//! - Promotion and demotion periods, register of members' activity, and rank based salaries (via +//! [AmbassadorCore](pallet_core_fellowship)). +//! - Members' salaries (via [AmbassadorSalary](pallet_salary), requiring a member to be imported or +//! inducted into [AmbassadorCore](pallet_core_fellowship)). //! - Ambassador Program Sub-Treasury (via [AmbassadorTreasury](pallet_treasury)). pub mod migrations; diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs index 691fd10f24..adb076fc8a 100644 --- a/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs @@ -15,6 +15,7 @@ //! The Ambassador Program's origins. +#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_origins { use crate::ambassador::ranks; diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs index ed998422a0..10213635c7 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/origins.rs @@ -19,6 +19,7 @@ use super::ranks; pub use pallet_origins::*; +#[allow(unreachable_patterns)] #[frame_support::pallet] pub mod pallet_origins { use super::ranks; @@ -134,7 +135,9 @@ pub mod pallet_origins { /// A `TryMorph` implementation which is designed to convert an aggregate `RuntimeOrigin` /// value into the Fellowship voice it represents if it is a Fellowship pallet origin an - /// appropriate variant. See also [Origin::as_voice]. + /// appropriate variant. + /// + /// See also [Origin::as_voice]. pub struct ToVoice; impl<'a, O: 'a + TryInto<&'a Origin>> sp_runtime::traits::TryMorph for ToVoice { type Outcome = pallet_ranked_collective::Rank; diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index eccb696614..c8ccd42bd3 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -653,7 +653,9 @@ impl pallet_preimage::Config for Runtime { } /// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the -/// `AssetRate` pallet instance, with additional decoration to identify different IDs/locations of +/// `AssetRate` pallet instance. +/// +/// With additional decoration to identify different IDs/locations of /// native asset and provide a one-to-one balance conversion for them. pub type AssetRateWithNative = UnityOrOuterConversion< ContainsLocationParts< diff --git a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs index efb2fe532f..7e37611c76 100644 --- a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs +++ b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs @@ -76,9 +76,10 @@ parameter_types! { pub SelfParaId: ParaId = ParachainInfo::parachain_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -107,8 +108,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/constants/src/lib.rs b/system-parachains/constants/src/lib.rs index 7f31f7e149..e6e2012c35 100644 --- a/system-parachains/constants/src/lib.rs +++ b/system-parachains/constants/src/lib.rs @@ -27,9 +27,10 @@ use frame_support::{ pub use parachains_common::BlockNumber; use sp_runtime::Perbill; -/// This determines the average expected block time that we are targeting. Blocks will be -/// produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is picked up by -/// `pallet_timestamp` which is in turn picked up by `pallet_aura` to implement `fn +/// This determines the average expected block time that we are targeting. +/// +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is +/// picked up by `pallet_timestamp` which is in turn picked up by `pallet_aura` to implement `fn /// slot_duration()`. /// /// Change this to adjust the block time. diff --git a/system-parachains/coretime/coretime-kusama/src/xcm_config.rs b/system-parachains/coretime/coretime-kusama/src/xcm_config.rs index df0adb72c4..3869ca63d7 100644 --- a/system-parachains/coretime/coretime-kusama/src/xcm_config.rs +++ b/system-parachains/coretime/coretime-kusama/src/xcm_config.rs @@ -62,9 +62,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -111,8 +112,9 @@ pub type RegionTransactor = NonFungibleAdapter< pub type AssetTransactors = (FungibleTransactor, RegionTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with XCM's `Transact`. +/// +/// There is an `OriginKind` that can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/coretime/coretime-polkadot/src/lib.rs b/system-parachains/coretime/coretime-polkadot/src/lib.rs index 6ae37db720..41c30ac263 100644 --- a/system-parachains/coretime/coretime-polkadot/src/lib.rs +++ b/system-parachains/coretime/coretime-polkadot/src/lib.rs @@ -180,9 +180,10 @@ parameter_types! { pub const SS58Prefix: u8 = 0; } -/// Filter out credit purchase calls until the credit system is implemented. Otherwise, users -/// may have chance of locking their funds forever on purchased credits they cannot use. -/// Also filter the interlace call until the relay can support this fully. +/// Filter out credit purchase calls until the credit system is implemented. +/// +/// Otherwise, users may have chance of locking their funds forever on purchased credits they cannot +/// use. Also filter the interlace call until the relay can support this fully. pub struct IsFilteredBrokerCall; impl Contains for IsFilteredBrokerCall { fn contains(c: &RuntimeCall) -> bool { diff --git a/system-parachains/coretime/coretime-polkadot/src/xcm_config.rs b/system-parachains/coretime/coretime-polkadot/src/xcm_config.rs index c75c0a574c..e3b46d0d41 100644 --- a/system-parachains/coretime/coretime-polkadot/src/xcm_config.rs +++ b/system-parachains/coretime/coretime-polkadot/src/xcm_config.rs @@ -63,9 +63,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -112,8 +113,9 @@ pub type RegionTransactor = NonFungibleAdapter< pub type AssetTransactors = (FungibleTransactor, RegionTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with XCM's `Transact`. +/// +/// There is an `OriginKind` that can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index db28814684..f93906d02e 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -746,9 +746,10 @@ construct_runtime! { } } -/// This determines the average expected block time that we are targeting. Blocks will be -/// produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is picked up by -/// `pallet_timestamp`, which is in turn picked up by `pallet_aura` to implement `fn +/// This determines the average expected block time that we are targeting. +/// +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is +/// picked up by `pallet_timestamp`, which is in turn picked up by `pallet_aura` to implement `fn /// slot_duration()`. /// /// Change this to adjust the block time. diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs index 50cacb1e5b..af152d6afc 100644 --- a/system-parachains/encointer/src/xcm_config.rs +++ b/system-parachains/encointer/src/xcm_config.rs @@ -54,9 +54,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -83,8 +84,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs b/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs index 00dbd9cea1..b92f5e24e1 100644 --- a/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs +++ b/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs @@ -34,8 +34,9 @@ parameter_types! { } /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 3cc6c85e53..619cd0422d 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -84,9 +84,10 @@ use xcm_runtime_apis::{ fees::Error as XcmPaymentApiError, }; -/// This determines the average expected block time that we are targeting. Blocks will be -/// produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is picked up by -/// `pallet_timestamp`, which is in turn picked up by `pallet_aura` to implement `fn +/// This determines the average expected block time that we are targeting. +/// +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is +/// picked up by `pallet_timestamp`, which is in turn picked up by `pallet_aura` to implement `fn /// slot_duration()`. /// /// Change this to adjust the block time. diff --git a/system-parachains/people/people-kusama/src/xcm_config.rs b/system-parachains/people/people-kusama/src/xcm_config.rs index 54b0c75b66..fe7ac7c4c6 100644 --- a/system-parachains/people/people-kusama/src/xcm_config.rs +++ b/system-parachains/people/people-kusama/src/xcm_config.rs @@ -84,9 +84,10 @@ pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender: XcmpQueue, >; -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -115,8 +116,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with XCM's `Transact`. +/// +/// There is an `OriginKind` that can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for diff --git a/system-parachains/people/people-polkadot/src/xcm_config.rs b/system-parachains/people/people-polkadot/src/xcm_config.rs index 2a0e80d4d3..0b9e1c110d 100644 --- a/system-parachains/people/people-polkadot/src/xcm_config.rs +++ b/system-parachains/people/people-polkadot/src/xcm_config.rs @@ -85,9 +85,10 @@ pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender: XcmpQueue, >; -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -116,8 +117,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with XCM's `Transact`. +/// +/// There is an `OriginKind` that can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for