From 2ed11b87a83337db503d2acacbf2df4c6c9ac17f Mon Sep 17 00:00:00 2001 From: Martin Hloska Date: Wed, 5 Jul 2023 19:39:33 +0200 Subject: [PATCH] update weights calls --- pallets/stableswap/src/lib.rs | 4 ++-- pallets/stableswap/src/weights.rs | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pallets/stableswap/src/lib.rs b/pallets/stableswap/src/lib.rs index a6cd89c82..c9ce537f1 100644 --- a/pallets/stableswap/src/lib.rs +++ b/pallets/stableswap/src/lib.rs @@ -368,7 +368,7 @@ pub mod pallet { /// /// Emits `FeesUpdated` event if successful. #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::update_pool())] + #[pallet::weight(::WeightInfo::update_pool_fees())] #[transactional] pub fn update_pool_fees( origin: OriginFor, @@ -407,7 +407,7 @@ pub mod pallet { /// /// Emits `AmplificationUpdated` event if successful. #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::update_pool())] + #[pallet::weight(::WeightInfo::update_amplification())] #[transactional] pub fn update_amplification( origin: OriginFor, diff --git a/pallets/stableswap/src/weights.rs b/pallets/stableswap/src/weights.rs index 751b870f8..37e3026c9 100644 --- a/pallets/stableswap/src/weights.rs +++ b/pallets/stableswap/src/weights.rs @@ -46,12 +46,13 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_stableswap. pub trait WeightInfo { fn create_pool() -> Weight; - fn update_pool() -> Weight; fn add_liquidity() -> Weight; fn remove_liquidity_one_asset() -> Weight; fn sell() -> Weight; fn buy() -> Weight; fn set_asset_tradable_state() -> Weight; + fn update_pool_fees() -> Weight; + fn update_amplification() -> Weight; } pub struct BasiliskWeight(PhantomData); @@ -63,10 +64,6 @@ impl WeightInfo for BasiliskWeight { .saturating_add(T::DbWeight::get().writes(12 as u64)) } - fn update_pool() -> Weight { - Weight::from_ref_time(0u128 as u64) - } - fn add_liquidity() -> Weight { Weight::from_ref_time(64_481_000 as u64) .saturating_add(T::DbWeight::get().reads(10 as u64)) @@ -87,10 +84,15 @@ impl WeightInfo for BasiliskWeight { .saturating_add(T::DbWeight::get().reads(9 as u64)) .saturating_add(T::DbWeight::get().writes(5 as u64)) } - fn set_asset_tradable_state() -> Weight { Weight::from_ref_time(0) } + fn update_pool_fees() -> Weight { + Weight::from_ref_time(0) + } + fn update_amplification() -> Weight { + Weight::from_ref_time(0) + } } // For backwards compatibility and tests @@ -100,9 +102,6 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(13 as u64)) .saturating_add(RocksDbWeight::get().writes(12 as u64)) } - fn update_pool() -> Weight { - Weight::from_ref_time(0u128 as u64) - } fn add_liquidity() -> Weight { Weight::from_ref_time(64_481_000 as u64) .saturating_add(RocksDbWeight::get().reads(10 as u64)) @@ -127,4 +126,10 @@ impl WeightInfo for () { fn set_asset_tradable_state() -> Weight { Weight::from_ref_time(0) } + fn update_pool_fees() -> Weight { + Weight::from_ref_time(0) + } + fn update_amplification() -> Weight { + Weight::from_ref_time(0) + } }