diff --git a/pallets/issue/src/benchmarking.rs b/pallets/issue/src/benchmarking.rs index 13b846bd6..76a3be51b 100644 --- a/pallets/issue/src/benchmarking.rs +++ b/pallets/issue/src/benchmarking.rs @@ -28,12 +28,17 @@ fn deposit_tokens( account_id: &T::AccountId, amount: BalanceOf, ) { - assert_ok!(>::deposit(currency_id, account_id, amount)); + assert_ok!(>::deposit(currency_id, account_id, amount)); } fn mint_collateral(account_id: &T::AccountId, amount: BalanceOf) { deposit_tokens::(get_collateral_currency_id::(), account_id, amount); deposit_tokens::(get_native_currency_id::(), account_id, amount); + deposit_tokens::( + ::GetGriefingCollateralCurrencyId::get(), + account_id, + amount, + ); } fn get_currency_pair() -> DefaultVaultCurrencyPair { @@ -61,8 +66,7 @@ benchmarks! { request_issue { let origin: T::AccountId = account("Origin", 0, 0); let vault_id = get_vault_id::(); - let amount = 10_000_000u32.into(); - let asset = vault_id.wrapped_currency(); + let amount = Issue::::issue_minimum_transfer_amount(vault_id.wrapped_currency()).amount(); let relayer_id: T::AccountId = account("Relayer", 0, 0); Oracle::::_set_exchange_rate(origin.clone(), get_collateral_currency_id::(), ::UnsignedFixedPoint::one()).unwrap(); diff --git a/pallets/issue/src/default_weights.rs b/pallets/issue/src/default_weights.rs index 1f83ca588..393fd97cd 100644 --- a/pallets/issue/src/default_weights.rs +++ b/pallets/issue/src/default_weights.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-04-02, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-05-23, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `Bogdans-M2-MacBook-Pro.local`, CPU: `` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 @@ -77,8 +77,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2192` // Estimated: `5657` - // Minimum execution time: 57_000_000 picoseconds. - Weight::from_parts(60_000_000, 5657) + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(58_000_000, 5657) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -104,8 +104,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2190` // Estimated: `71867` - // Minimum execution time: 3_807_000_000 picoseconds. - Weight::from_parts(3_911_000_000, 71867) + // Minimum execution time: 3_926_000_000 picoseconds. + Weight::from_parts(3_982_000_000, 71867) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -121,8 +121,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1199` // Estimated: `4664` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4664) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4664) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -146,8 +146,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(5_000_000, 0) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Issue IssueMinimumTransferAmount (r:0 w:1) @@ -156,7 +156,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. + // Minimum execution time: 3_000_000 picoseconds. Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -200,8 +200,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2192` // Estimated: `5657` - // Minimum execution time: 57_000_000 picoseconds. - Weight::from_parts(60_000_000, 5657) + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(58_000_000, 5657) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -227,8 +227,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2190` // Estimated: `71867` - // Minimum execution time: 3_807_000_000 picoseconds. - Weight::from_parts(3_911_000_000, 71867) + // Minimum execution time: 3_926_000_000 picoseconds. + Weight::from_parts(3_982_000_000, 71867) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -244,8 +244,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1199` // Estimated: `4664` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 4664) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 4664) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -269,8 +269,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(5_000_000, 0) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Issue IssueMinimumTransferAmount (r:0 w:1) @@ -279,7 +279,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. + // Minimum execution time: 3_000_000 picoseconds. Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) }