Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
Valentin Fernandez committed May 22, 2023
commit 4bcd1599d196655198c22ee611d6135edd50424a
8 changes: 4 additions & 4 deletions pallets/benchmarks/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ benchmarks! {
let asset = MultiAsset { id: XcmAssetId::Concrete(location), fun: Fungibility::Fungible(100) };
} : {
T::DropAssets::drop_assets(
&origin,
&origin,
asset.into(),
&XcmContext {
origin: Some(origin.clone()),
Expand All @@ -30,7 +30,7 @@ benchmarks! {
let asset = MultiAsset { id: XcmAssetId::Concrete(location), fun: Fungibility::Fungible(amount) };
} : {
T::DropAssets::drop_assets(
&origin,
&origin,
asset.into(),
&XcmContext {
origin: Some(origin.clone()),
Expand All @@ -45,7 +45,7 @@ benchmarks! {
let asset = MultiAsset { id: XcmAssetId::Abstract(Default::default()), fun: Fungibility::Fungible(0) };
} : {
T::DropAssets::drop_assets(
&origin,
&origin,
asset.into(),
&XcmContext {
origin: Some(origin.clone()),
Expand All @@ -54,4 +54,4 @@ benchmarks! {
},
);
}
}
}
2 changes: 1 addition & 1 deletion pallets/benchmarks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ pub mod pallet {

#[pallet::pallet]
pub struct Pallet<T>(_);
}
}
2 changes: 1 addition & 1 deletion pallets/benchmarks/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pub trait WeightInfo {
fn drop_assets_fungible() -> Weight;
fn drop_assets_native() -> Weight;
fn drop_assets_default() -> Weight;
}
}
8 changes: 4 additions & 4 deletions primitives/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

use frame_support::{
sp_runtime::SaturatedConversion,
traits::{fungibles::Inspect, Currency}, weights::Weight,
traits::{fungibles::Inspect, Currency},
weights::Weight,
};
use sp_std::{borrow::Borrow, marker::PhantomData};
use xcm::{
Expand Down Expand Up @@ -97,15 +98,15 @@ impl<AssetId, AssetIdInfoGetter, AssetsPallet, BalancesPallet, XcmPallet, Accoun
BalancesPallet,
XcmPallet,
AccountId,
Weigher
Weigher,
> where
AssetId: Clone,
AssetIdInfoGetter: AssetMultiLocationGetter<AssetId>,
AssetsPallet: Inspect<AccountId, AssetId = AssetId>,
BalancesPallet: Currency<AccountId>,
XcmPallet: DropAssets,
Weigher: DropAssetsWeigher,
{
{
// assets are whatever the Holding Register had when XCVM halts
fn drop_assets(origin: &MultiLocation, mut assets: Assets, context: &XcmContext) -> Weight {
const NATIVE_LOCATION: MultiLocation = MultiLocation { parents: 0, interior: Here };
Expand Down Expand Up @@ -147,4 +148,3 @@ impl<AssetId, AssetIdInfoGetter, AssetsPallet, BalancesPallet, XcmPallet, Accoun
weight.saturating_add(XcmPallet::drop_assets(origin, assets, context))
}
}

2 changes: 1 addition & 1 deletion runtime/trappist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
pub mod constants;
mod contracts;
pub mod impls;
pub mod xcm_config;
mod weights;
pub mod xcm_config;

pub use common::AssetIdForTrustBackedAssets;
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
Expand Down
2 changes: 1 addition & 1 deletion runtime/trappist/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ impl DropAssetsWeigher for TrappistDropAssetsWeigher {
fn default() -> Weight {
trappist_runtime_benchmarks::WeightInfo::<Runtime>::drop_assets_default()
}
}
}
4 changes: 3 additions & 1 deletion runtime/trappist/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
// limitations under the License.

use crate::{
constants::fee::default_fee_per_second, impls::ToAuthor, AllPalletsWithSystem, weights::TrappistDropAssetsWeigher};
constants::fee::default_fee_per_second, impls::ToAuthor, weights::TrappistDropAssetsWeigher,
AllPalletsWithSystem,
};

use super::{
AccountId, AssetRegistry, Assets, Balance, Balances, ParachainInfo, ParachainSystem,
Expand Down