Move LockableCurrency trait to fungibles::Lockable and deprecate LockableCurrency (#12798)

* WIP move LockableCurrency to fungibles

* rename Lockable and LockIdentifier to funginbles::*

* fix imports further

* change Lockable from fungible to fungibles

* reintroduce LockableCurrency but marked as deprecated

* fix imports

* fix imports

* cargo fmt

* add allow deprecated warnings

* remove unused benchmark import

* fix some of the docs

* fix failing doctest check

* reexport LockIdentifier and LockableCurrency from support/traits

* reexport LockIdentifier and LockableCurrency from support/traits

* allow using deprecated re-export

* replace LockableCurrency and LockIdentifier with a module alias

* Update frame/support/src/traits/tokens/fungibles/lockable.rs

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: Squirrel <gilescope@gmail.com>

* Update frame/support/src/traits.rs

Co-authored-by: Squirrel <gilescope@gmail.com>

* REVERT removing fungibles::Lockable import

Co-authored-by: parity-processbot <>
Co-authored-by: Squirrel <gilescope@gmail.com>
This commit is contained in:
Anthony Alaribe
2022-12-08 14:47:13 +02:00
committed by GitHub
parent 39cb3b06cd
commit 9a014d1ecd
20 changed files with 135 additions and 105 deletions
+3 -2
View File
@@ -25,8 +25,9 @@ use frame_support::{
dispatch::WithPostDispatchInfo,
pallet_prelude::*,
traits::{
Currency, CurrencyToVote, Defensive, DefensiveResult, EstimateNextNewSession, Get,
Imbalance, LockableCurrency, OnUnbalanced, TryCollect, UnixTime, WithdrawReasons,
fungibles::Lockable, Currency, CurrencyToVote, Defensive, DefensiveResult,
EstimateNextNewSession, Get, Imbalance, OnUnbalanced, TryCollect, UnixTime,
WithdrawReasons,
},
weights::Weight,
};
+4 -4
View File
@@ -24,8 +24,8 @@ use frame_support::{
dispatch::Codec,
pallet_prelude::*,
traits::{
Currency, CurrencyToVote, Defensive, DefensiveResult, DefensiveSaturating, EnsureOrigin,
EstimateNextNewSession, Get, LockIdentifier, LockableCurrency, OnUnbalanced, TryCollect,
fungibles, fungibles::Lockable, Currency, CurrencyToVote, Defensive, DefensiveResult,
DefensiveSaturating, EnsureOrigin, EstimateNextNewSession, Get, OnUnbalanced, TryCollect,
UnixTime,
},
weights::Weight,
@@ -50,7 +50,7 @@ use crate::{
ValidatorPrefs,
};
const STAKING_ID: LockIdentifier = *b"staking ";
const STAKING_ID: fungibles::LockIdentifier = *b"staking ";
#[frame_support::pallet]
pub mod pallet {
@@ -78,7 +78,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// The staking balance.
type Currency: LockableCurrency<
type Currency: fungibles::Lockable<
Self::AccountId,
Moment = Self::BlockNumber,
Balance = Self::CurrencyBalance,