diff --git a/pallets/vtoken-minting/src/benchmarking.rs b/pallets/vtoken-minting/src/benchmarking.rs index c62a3bf31..d0d20b405 100644 --- a/pallets/vtoken-minting/src/benchmarking.rs +++ b/pallets/vtoken-minting/src/benchmarking.rs @@ -62,6 +62,22 @@ benchmarks! { let origin = T::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; }: _(origin, 10u32) + set_unlocking_total { + let origin = T::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let token = CurrencyId::Token(TokenSymbol::KSM); + let token_amount = BalanceOf::::unique_saturated_from(1000u32 as u128); + }: _(origin, token, token_amount) + + set_min_time_unit { + let origin = T::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let token = CurrencyId::Token(TokenSymbol::KSM); + }: _(origin, token, TimeUnit::Era(1)) + + recreate_currency_ongoing_time_unit { + let origin = T::ControlOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let token = CurrencyId::Token(TokenSymbol::KSM); + }: _(origin, token, TimeUnit::Era(1)) + mint { let caller: T::AccountId = whitelisted_caller(); const KSM: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); diff --git a/pallets/vtoken-minting/src/lib.rs b/pallets/vtoken-minting/src/lib.rs index d40a79999..dccd5eb0a 100644 --- a/pallets/vtoken-minting/src/lib.rs +++ b/pallets/vtoken-minting/src/lib.rs @@ -778,7 +778,7 @@ pub mod pallet { } #[pallet::call_index(11)] - #[pallet::weight({0})] + #[pallet::weight(T::WeightInfo::set_unlocking_total())] pub fn set_unlocking_total( origin: OriginFor, token_id: CurrencyIdOf, @@ -793,7 +793,7 @@ pub mod pallet { } #[pallet::call_index(12)] - #[pallet::weight({0})] + #[pallet::weight(T::WeightInfo::set_min_time_unit())] pub fn set_min_time_unit( origin: OriginFor, token_id: CurrencyIdOf, @@ -808,7 +808,7 @@ pub mod pallet { } #[pallet::call_index(13)] - #[pallet::weight({0})] + #[pallet::weight(T::WeightInfo::recreate_currency_ongoing_time_unit())] pub fn recreate_currency_ongoing_time_unit( origin: OriginFor, token_id: CurrencyIdOf, diff --git a/pallets/vtoken-minting/src/weights.rs b/pallets/vtoken-minting/src/weights.rs index 2cdc0f2de..ef949d1f7 100644 --- a/pallets/vtoken-minting/src/weights.rs +++ b/pallets/vtoken-minting/src/weights.rs @@ -56,6 +56,9 @@ pub trait WeightInfo { fn set_minimum_mint() -> Weight; fn set_minimum_redeem() -> Weight; fn set_unlock_duration() -> Weight; + fn set_unlocking_total() -> Weight; + fn set_min_time_unit() -> Weight; + fn recreate_currency_ongoing_time_unit() -> Weight; fn add_support_rebond_token() -> Weight; fn remove_support_rebond_token() -> Weight; fn set_fees() -> Weight; @@ -65,7 +68,6 @@ pub trait WeightInfo { fn rebond() -> Weight; fn rebond_by_unlock_id() -> Weight; fn on_initialize() -> Weight; - fn recreate_currency_ongoing_time_unit() -> Weight; } // For backwards compatibility and tests @@ -105,6 +107,42 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `VtokenMinting::UnlockingTotal` (r:1 w:1) + /// Proof: `VtokenMinting::UnlockingTotal` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + fn set_unlocking_total() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 14_808_000 picoseconds. + Weight::from_parts(15_209_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) + .saturating_add(RocksDbWeight::get().reads(1)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::MinTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::MinTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn set_min_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_269_000 picoseconds. + Weight::from_parts(15_499_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(RocksDbWeight::get().reads(1)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::OngoingTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::OngoingTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn recreate_currency_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_209_000 picoseconds. + Weight::from_parts(15_509_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(RocksDbWeight::get().reads(1)) + .saturating_add(RocksDbWeight::get().writes(1)) + } /// Storage: VtokenMinting TokenToRebond (r:1 w:1) /// Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn add_support_rebond_token() -> Weight { @@ -279,10 +317,4 @@ impl WeightInfo for () { Weight::from_parts(15_243_000, 3492) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - - fn recreate_currency_ongoing_time_unit() -> Weight { - Weight::from_parts(70_238_000, 4197) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } } diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs index 5868cdd65..01106010b 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs @@ -89,6 +89,42 @@ impl bifrost_vtoken_minting::WeightInfo for BifrostWeig .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `VtokenMinting::UnlockingTotal` (r:1 w:1) + /// Proof: `VtokenMinting::UnlockingTotal` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + fn set_unlocking_total() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 14_808_000 picoseconds. + Weight::from_parts(15_209_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::MinTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::MinTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn set_min_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_269_000 picoseconds. + Weight::from_parts(15_499_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::OngoingTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::OngoingTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn recreate_currency_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_209_000 picoseconds. + Weight::from_parts(15_509_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } // Storage: VtokenMinting TokenToRebond (r:1 w:1) // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn add_support_rebond_token() -> Weight { @@ -263,10 +299,4 @@ impl bifrost_vtoken_minting::WeightInfo for BifrostWeig Weight::from_parts(16_763_000, 3492) .saturating_add(T::DbWeight::get().reads(1)) } - - fn recreate_currency_ongoing_time_unit() -> Weight { - Weight::from_parts(70_238_000, 4197) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } } diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs index 5868cdd65..01106010b 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_minting.rs @@ -89,6 +89,42 @@ impl bifrost_vtoken_minting::WeightInfo for BifrostWeig .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `VtokenMinting::UnlockingTotal` (r:1 w:1) + /// Proof: `VtokenMinting::UnlockingTotal` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + fn set_unlocking_total() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 14_808_000 picoseconds. + Weight::from_parts(15_209_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::MinTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::MinTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn set_min_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_269_000 picoseconds. + Weight::from_parts(15_499_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::OngoingTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::OngoingTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn recreate_currency_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_209_000 picoseconds. + Weight::from_parts(15_509_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } // Storage: VtokenMinting TokenToRebond (r:1 w:1) // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) fn add_support_rebond_token() -> Weight { @@ -263,10 +299,4 @@ impl bifrost_vtoken_minting::WeightInfo for BifrostWeig Weight::from_parts(16_763_000, 3492) .saturating_add(T::DbWeight::get().reads(1)) } - - fn recreate_currency_ongoing_time_unit() -> Weight { - Weight::from_parts(70_238_000, 4197) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } }