Nits found during the bumping fellows repo (#3410)

This commit is contained in:
Branislav Kontur
2024-02-20 22:00:44 +01:00
committed by GitHub
parent fee810a5ea
commit b77b3a2de5
11 changed files with 19 additions and 10 deletions
@@ -383,8 +383,8 @@ pub type ForeignAssetsInstance = pallet_assets::Instance2;
impl pallet_assets::Config<ForeignAssetsInstance> for Runtime { impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
type Balance = Balance; type Balance = Balance;
type AssetId = xcm::v3::MultiLocation; type AssetId = xcm::v3::Location;
type AssetIdParameter = xcm::v3::MultiLocation; type AssetIdParameter = xcm::v3::Location;
type Currency = Balances; type Currency = Balances;
type CreateOrigin = ForeignCreators< type CreateOrigin = ForeignCreators<
( (
@@ -1043,6 +1043,7 @@ mod benches {
[pallet_assets, Pool] [pallet_assets, Pool]
[pallet_asset_conversion, AssetConversion] [pallet_asset_conversion, AssetConversion]
[pallet_balances, Balances] [pallet_balances, Balances]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig] [pallet_multisig, Multisig]
[pallet_nft_fractionalization, NftFractionalization] [pallet_nft_fractionalization, NftFractionalization]
[pallet_nfts, Nfts] [pallet_nfts, Nfts]
@@ -1052,6 +1053,7 @@ mod benches {
[pallet_utility, Utility] [pallet_utility, Utility]
[pallet_timestamp, Timestamp] [pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection] [pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue] [cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_xcm_bridge_hub_router, ToWestend] [pallet_xcm_bridge_hub_router, ToWestend]
// XCM // XCM
@@ -1084,6 +1084,7 @@ mod benches {
[pallet_utility, Utility] [pallet_utility, Utility]
[pallet_timestamp, Timestamp] [pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection] [pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue] [cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_xcm_bridge_hub_router, ToRococo] [pallet_xcm_bridge_hub_router, ToRococo]
// XCM // XCM
@@ -371,7 +371,7 @@ mod tests {
for (asset, expected_result) in test_data { for (asset, expected_result) in test_data {
assert_eq!( assert_eq!(
<Convert as MatchesFungibles<xcm::v3::MultiLocation, u128>>::matches_fungibles( <Convert as MatchesFungibles<xcm::v3::Location, u128>>::matches_fungibles(
&asset.clone().try_into().unwrap() &asset.clone().try_into().unwrap()
), ),
expected_result, expected_result,
@@ -522,6 +522,7 @@ mod benches {
[pallet_utility, Utility] [pallet_utility, Utility]
[pallet_timestamp, Timestamp] [pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection] [pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue] [cumulus_pallet_xcmp_queue, XcmpQueue]
// XCM // XCM
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>] [pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
@@ -427,6 +427,7 @@ mod benches {
[pallet_sudo, Sudo] [pallet_sudo, Sudo]
[pallet_timestamp, Timestamp] [pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection] [pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[pallet_contracts, Contracts] [pallet_contracts, Contracts]
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>] [pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
); );
@@ -448,6 +448,7 @@ mod benches {
[frame_system, SystemBench::<Runtime>] [frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances] [pallet_balances, Balances]
[pallet_identity, Identity] [pallet_identity, Identity]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig] [pallet_multisig, Multisig]
[pallet_session, SessionBench::<Runtime>] [pallet_session, SessionBench::<Runtime>]
[pallet_utility, Utility] [pallet_utility, Utility]
@@ -455,6 +456,7 @@ mod benches {
// Polkadot // Polkadot
[polkadot_runtime_common::identity_migrator, IdentityMigrator] [polkadot_runtime_common::identity_migrator, IdentityMigrator]
// Cumulus // Cumulus
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue] [cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_collator_selection, CollatorSelection] [pallet_collator_selection, CollatorSelection]
// XCM // XCM
@@ -448,6 +448,7 @@ mod benches {
[frame_system, SystemBench::<Runtime>] [frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances] [pallet_balances, Balances]
[pallet_identity, Identity] [pallet_identity, Identity]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig] [pallet_multisig, Multisig]
[pallet_session, SessionBench::<Runtime>] [pallet_session, SessionBench::<Runtime>]
[pallet_utility, Utility] [pallet_utility, Utility]
@@ -455,6 +456,7 @@ mod benches {
// Polkadot // Polkadot
[polkadot_runtime_common::identity_migrator, IdentityMigrator] [polkadot_runtime_common::identity_migrator, IdentityMigrator]
// Cumulus // Cumulus
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue] [cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_collator_selection, CollatorSelection] [pallet_collator_selection, CollatorSelection]
// XCM // XCM
@@ -134,7 +134,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter<
ForeignAssets, ForeignAssets,
// Use this currency when it is a fungible asset matching the given location or name: // Use this currency when it is a fungible asset matching the given location or name:
ForeignAssetsConvertedConcreteId, ForeignAssetsConvertedConcreteId,
// Convert an XCM MultiLocation into a local account id: // Convert an XCM Location into a local account id:
LocationToAccountId, LocationToAccountId,
// Our chain's account ID type (we can't get away without mentioning it explicitly): // Our chain's account ID type (we can't get away without mentioning it explicitly):
AccountId, AccountId,
+4 -4
View File
@@ -107,7 +107,7 @@ pub fn era_payout(
)] )]
pub enum VersionedLocatableAsset { pub enum VersionedLocatableAsset {
#[codec(index = 3)] #[codec(index = 3)]
V3 { location: xcm::v3::MultiLocation, asset_id: xcm::v3::AssetId }, V3 { location: xcm::v3::Location, asset_id: xcm::v3::AssetId },
#[codec(index = 4)] #[codec(index = 4)]
V4 { location: xcm::v4::Location, asset_id: xcm::v4::AssetId }, V4 { location: xcm::v4::Location, asset_id: xcm::v4::AssetId },
} }
@@ -140,7 +140,7 @@ impl TryConvert<&VersionedLocation, xcm::latest::Location> for VersionedLocation
) -> Result<xcm::latest::Location, &VersionedLocation> { ) -> Result<xcm::latest::Location, &VersionedLocation> {
let latest = match location.clone() { let latest = match location.clone() {
VersionedLocation::V2(l) => { VersionedLocation::V2(l) => {
let v3: xcm::v3::MultiLocation = l.try_into().map_err(|_| location)?; let v3: xcm::v3::Location = l.try_into().map_err(|_| location)?;
v3.try_into().map_err(|_| location)? v3.try_into().map_err(|_| location)?
}, },
VersionedLocation::V3(l) => l.try_into().map_err(|_| location)?, VersionedLocation::V3(l) => l.try_into().map_err(|_| location)?,
@@ -191,11 +191,11 @@ pub mod benchmarks {
{ {
fn create_asset_kind(seed: u32) -> VersionedLocatableAsset { fn create_asset_kind(seed: u32) -> VersionedLocatableAsset {
VersionedLocatableAsset::V3 { VersionedLocatableAsset::V3 {
location: xcm::v3::MultiLocation::new( location: xcm::v3::Location::new(
Parents::get(), Parents::get(),
[xcm::v3::Junction::Parachain(ParaId::get())], [xcm::v3::Junction::Parachain(ParaId::get())],
), ),
asset_id: xcm::v3::MultiLocation::new( asset_id: xcm::v3::Location::new(
0, 0,
[ [
xcm::v3::Junction::PalletInstance(seed.try_into().unwrap()), xcm::v3::Junction::PalletInstance(seed.try_into().unwrap()),
+1 -1
View File
@@ -494,7 +494,7 @@ pub trait WrapVersion {
} }
/// Check and return the `Version` that should be used for the `Xcm` datum for the destination /// Check and return the `Version` that should be used for the `Xcm` datum for the destination
/// `MultiLocation`, which will interpret it. /// `Location`, which will interpret it.
pub trait GetVersion { pub trait GetVersion {
fn get_version_for(dest: &latest::Location) -> Option<Version>; fn get_version_for(dest: &latest::Location) -> Option<Version>;
} }
+1 -1
View File
@@ -40,7 +40,7 @@
//! non-native asset 1, you would pass in a path of `[DOT, 1]` or `[1, DOT]`. If you want to swap //! non-native asset 1, you would pass in a path of `[DOT, 1]` or `[1, DOT]`. If you want to swap
//! from non-native asset 1 to non-native asset 2, you would pass in a path of `[1, DOT, 2]`. //! from non-native asset 1 to non-native asset 2, you would pass in a path of `[1, DOT, 2]`.
//! //!
//! (For an example of configuring this pallet to use `MultiLocation` as an asset id, see the //! (For an example of configuring this pallet to use `Location` as an asset id, see the
//! cumulus repo). //! cumulus repo).
//! //!
//! Here is an example `state_call` that asks for a quote of a pool of native versus asset 1: //! Here is an example `state_call` that asks for a quote of a pool of native versus asset 1: