difftreelog
feat switch `configuration` from `Currency` trait to `fungible::*` traits
in: master
2 files changed
pallets/configuration/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/configuration/src/benchmarking.rs
+++ b/pallets/configuration/src/benchmarking.rs
@@ -19,7 +19,7 @@
use super::*;
use frame_benchmarking::benchmarks;
use frame_system::{EventRecord, RawOrigin};
-use frame_support::{assert_ok, traits::Currency};
+use frame_support::{assert_ok, traits::fungible::Inspect};
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
@@ -68,7 +68,7 @@
}
set_collator_selection_license_bond {
- let bond_cost: Option<BalanceOf<T>> = Some(T::Currency::minimum_balance() * 10u32.into());
+ let bond_cost: Option<BalanceOf<T>> = Some(T::Balances::minimum_balance() * 10u32.into());
}: {
assert_ok!(
<Pallet<T>>::set_collator_selection_license_bond(RawOrigin::Root.into(), bond_cost.clone())
pallets/configuration/src/lib.rsdiffbeforeafterboth42mod pallet {42mod pallet {43 use super::*;43 use super::*;44 use frame_support::{44 use frame_support::{45 traits::{Get, ReservableCurrency, Currency},45 traits::{fungible, Get, ReservableCurrency, Currency},46 pallet_prelude::{StorageValue, ValueQuery, DispatchResult, IsType},46 pallet_prelude::{StorageValue, ValueQuery, DispatchResult, IsType},47 log,47 log,48 };48 };49 use frame_system::{pallet_prelude::OriginFor, ensure_root, Config as SystemConfig};49 use frame_system::{pallet_prelude::OriginFor, ensure_root, Config as SystemConfig};505051 pub use crate::weights::WeightInfo;51 pub use crate::weights::WeightInfo;52 pub type BalanceOf<T> =52 pub type BalanceOf<T> = 53 <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance;53 <<T as Config>::Balances as fungible::Inspect<<T as SystemConfig>::AccountId>>::Balance;545455 #[pallet::config]55 #[pallet::config]56 pub trait Config: frame_system::Config {56 pub trait Config: frame_system::Config {57 /// Overarching event type.57 /// Overarching event type.58 type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;58 type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;595960 /// The currency mechanism.61 type Currency: ReservableCurrency<Self::AccountId>;60 type Balances:61 fungible::Inspect<Self::AccountId>62 + fungible::Mutate::<Self::AccountId>63 + fungible::MutateFreeze::<Self::AccountId>64 + fungible::InspectHold::<Self::AccountId>65 + fungible::MutateHold::<Self::AccountId>66 + fungible::BalancedHold::<Self::AccountId>;626763 #[pallet::constant]68 #[pallet::constant]64 type DefaultWeightToFeeCoefficient: Get<u64>;69 type DefaultWeightToFeeCoefficient: Get<u64>;