Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ macro_rules! impl_foreign_assets_helpers_for_parachain {
<Self as [<$chain ParaPallet>]>::ForeignAssets::set_reserves(
owner_origin,
id.clone(),
reserves,
reserves.try_into().unwrap(),
)
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn penpal_set_foreign_asset_reserves_on_asset_hub(
pallet_assets::Instance2,
>::set_reserves {
id: asset_id_on_ah.into(),
reserves,
reserves: reserves.try_into().unwrap(),
})
.encode()
.into();
Expand Down Expand Up @@ -483,7 +483,7 @@ fn verify_foreign_asset_origin_checks() {
<AssetHubWestend as AssetHubWestendPallet>::ForeignAssets::set_reserves(
origin,
foreign_asset_location_on_ah.clone(),
vec![reserves_data.clone()],
vec![reserves_data.clone()].try_into().unwrap(),
)
.unwrap();
assert_expected_events!(
Expand All @@ -501,7 +501,7 @@ fn verify_foreign_asset_origin_checks() {
assert!(<AssetHubWestend as AssetHubWestendPallet>::ForeignAssets::set_reserves(
origin,
foreign_asset_location_on_ah.clone(),
vec![reserves_data],
vec![reserves_data].try_into().unwrap(),
)
.is_err());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use core::marker::PhantomData;

/// Weight functions for `pallet_assets`.
pub struct WeightInfo<T>(PhantomData<T>);

impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Expand Down Expand Up @@ -109,7 +110,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `c` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
fn destroy_accounts(c: u32, ) -> Weight {
fn destroy_accounts(c: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `0 + c * (208 ±0)`
// Estimated: `4273 + c * (3207 ±0)`
Expand All @@ -131,7 +132,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `a` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
fn destroy_approvals(a: u32, ) -> Weight {
fn destroy_approvals(a: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `413 + a * (86 ±0)`
// Estimated: `4273 + a * (3221 ±0)`
Expand Down Expand Up @@ -338,7 +339,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn set_metadata(_n: u32, s: u32, ) -> Weight {
fn set_metadata(_n: u32, s: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `242`
// Estimated: `4273`
Expand Down Expand Up @@ -374,7 +375,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn force_set_metadata(n: u32, s: u32, ) -> Weight {
fn force_set_metadata(n: u32, s: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `81`
// Estimated: `4273`
Expand Down Expand Up @@ -625,8 +626,13 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(Weight::from_parts(0, 4211))
.saturating_add(T::DbWeight::get().reads(1))
}
fn set_reserves() -> Weight {
/// The range of component `n` is `[0, 5]`.
/// The range of component `n` is `[0, 5]`.
/// The range of component `n` is `[0, 5]`.
fn set_reserves(n: u32) -> Weight {
Weight::from_parts(31_972_000, 3675)
// Standard Error: 13_748
.saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use core::marker::PhantomData;

/// Weight functions for `pallet_assets`.
pub struct WeightInfo<T>(PhantomData<T>);

impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
Expand Down Expand Up @@ -107,7 +108,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `c` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
fn destroy_accounts(c: u32, ) -> Weight {
fn destroy_accounts(c: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `0 + c * (208 ±0)`
// Estimated: `3675 + c * (2609 ±0)`
Expand All @@ -129,7 +130,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `a` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
fn destroy_approvals(a: u32, ) -> Weight {
fn destroy_approvals(a: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `451 + a * (86 ±0)`
// Estimated: `3675 + a * (2623 ±0)`
Expand Down Expand Up @@ -336,7 +337,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn set_metadata(_n: u32, _s: u32, ) -> Weight {
fn set_metadata(_n: u32, _s: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `280`
// Estimated: `3675`
Expand Down Expand Up @@ -370,7 +371,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn force_set_metadata(n: u32, s: u32, ) -> Weight {
fn force_set_metadata(n: u32, s: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `119`
// Estimated: `3675`
Expand Down Expand Up @@ -621,8 +622,13 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(Weight::from_parts(0, 3613))
.saturating_add(T::DbWeight::get().reads(1))
}
fn set_reserves() -> Weight {
/// The range of component `n` is `[0, 5]`.
/// The range of component `n` is `[0, 5]`.
/// The range of component `n` is `[0, 5]`.
fn set_reserves(n: u32) -> Weight {
Weight::from_parts(31_972_000, 3675)
// Standard Error: 13_748
.saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use core::marker::PhantomData;

/// Weight functions for `pallet_assets`.
pub struct WeightInfo<T>(PhantomData<T>);

impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// Storage: `PoolAssets::Asset` (r:1 w:1)
/// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
Expand Down Expand Up @@ -105,7 +106,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `c` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
/// The range of component `c` is `[0, 1000]`.
fn destroy_accounts(c: u32, ) -> Weight {
fn destroy_accounts(c: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `0 + c * (208 ±0)`
// Estimated: `3675 + c * (2609 ±0)`
Expand All @@ -127,7 +128,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `a` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
/// The range of component `a` is `[0, 1000]`.
fn destroy_approvals(a: u32, ) -> Weight {
fn destroy_approvals(a: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `451 + a * (86 ±0)`
// Estimated: `3675 + a * (2623 ±0)`
Expand Down Expand Up @@ -334,7 +335,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn set_metadata(n: u32, _s: u32, ) -> Weight {
fn set_metadata(n: u32, _s: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `280`
// Estimated: `3675`
Expand Down Expand Up @@ -370,7 +371,7 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn force_set_metadata(_n: u32, s: u32, ) -> Weight {
fn force_set_metadata(_n: u32, s: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `119`
// Estimated: `3675`
Expand Down Expand Up @@ -615,8 +616,13 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(Weight::from_parts(0, 3613))
.saturating_add(T::DbWeight::get().reads(1))
}
fn set_reserves() -> Weight {
/// The range of component `n` is `[0, 5]`.
/// The range of component `n` is `[0, 5]`.
/// The range of component `n` is `[0, 5]`.
fn set_reserves(n: u32) -> Weight {
Weight::from_parts(31_972_000, 3675)
// Standard Error: 13_748
.saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
assert_ok!(ForeignAssets::set_reserves(
RuntimeOrigin::signed(account),
roc_id.clone().into(),
vec![reserves.clone()],
vec![reserves.clone()].try_into().unwrap(),
));
(reserves.reserve, roc)
});
Expand Down
Loading
Loading