From 5ea72dda6e4fa291f4333d9da92c306fbab58287 Mon Sep 17 00:00:00 2001 From: dmoka Date: Mon, 31 Jul 2023 12:55:55 +0200 Subject: [PATCH] make update balance compile --- pallets/dca/src/benchmarks.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pallets/dca/src/benchmarks.rs b/pallets/dca/src/benchmarks.rs index 983082847..94f2aa3b3 100644 --- a/pallets/dca/src/benchmarks.rs +++ b/pallets/dca/src/benchmarks.rs @@ -144,7 +144,7 @@ fn schedule_sell_fake(to: u32) where T: pallet_ema_oracle::Config, - CurrencyOf: MultiCurrencyExtended, + OmnipoolCurrencyOf: MultiCurrencyExtended, T: crate::pallet::Config, ::AssetId: From, ::AssetId: From, @@ -170,7 +170,7 @@ pub fn create_bounded_vec( bounded_vec } -type CurrencyOf = ::Currency; +type OmnipoolCurrencyOf = ::Currency; type OmnipoolPallet = pallet_omnipool::Pallet; type StableswapPallet = pallet_stableswap::Pallet; @@ -215,6 +215,9 @@ pub fn init_stableswap::AssetId: From, ::AssetId: Into, + T: MultiCurrencyExtended, + ::AssetId: From<>::CurrencyId>, + ::AssetId: Into<>::CurrencyId>, { let caller: AccountId = account("caller", 0, 1); let lp_provider: AccountId = account("provider", 0, 1); @@ -230,6 +233,7 @@ where //let asset_id = regi_asset(name.clone(), 1_000_000, 10000 + idx as u32)?; let asset_id = ::AssetRegistry::create_asset(&name, 1u128)?; asset_ids.push(asset_id); + T::update_balance(asset_id.into(), &caller.clone(), 1_000_000_000_000_000i128)?; /*::Currency::update_balance( RawOrigin::Root.into(), caller.clone(), @@ -310,7 +314,7 @@ fn fund( currency: ::AssetId, amount: Balance, ) -> DispatchResult { - CurrencyOf::::deposit(currency, &to, amount) + OmnipoolCurrencyOf::::deposit(currency, &to, amount) } //NOTE: This is necessary for oracle to provide price. @@ -344,7 +348,7 @@ where fn create_account_with_native_balance( ) -> Result where - CurrencyOf: MultiCurrencyExtended, + OmnipoolCurrencyOf: MultiCurrencyExtended, T: crate::pallet::Config + pallet_omnipool::Config, ::AssetId: From, { @@ -357,7 +361,7 @@ where benchmarks! { where_clause { where - CurrencyOf: MultiCurrencyExtended, + OmnipoolCurrencyOf: MultiCurrencyExtended, T: crate::pallet::Config + pallet_omnipool::Config + pallet_ema_oracle::Config + pallet_route_executor::Config, ::AssetId: From, ::AssetId: From,