Refactor pallet-state-trie-migration to fungible::* traits (#1801)

## Summary

This PR consolidates `pallet-state-trie-migration` as a part of
https://github.com/paritytech/polkadot-sdk/issues/226 /
https://github.com/paritytech/polkadot-sdk/issues/171:

`pallet-state-trie-migration`:
- [x] replace `Currency` with `fungible` traits
- [x] run benchmarks
- [x] refactor to `DefaultConfig`

`pallet_nicks`:
- [x]  remove

others:
- [x] remove `as Fn*` or `asFun*` stuff based on discussion
[here](https://github.com/paritytech/polkadot-sdk/issues/226#issuecomment-1822861445)

---------

Co-authored-by: Richard Melkonian <35300528+0xmovses@users.noreply.github.com>
Co-authored-by: command-bot <>
This commit is contained in:
Branislav Kontur
2024-01-24 14:18:54 +01:00
committed by GitHub
parent a989ddfab9
commit 4374b5d598
17 changed files with 312 additions and 789 deletions
+4 -7
View File
@@ -357,10 +357,7 @@ use frame_support::{
pallet_prelude::{MaxEncodedLen, *},
storage::bounded_btree_map::BoundedBTreeMap,
traits::{
fungible::{
Inspect as FunInspect, InspectFreeze, Mutate as FunMutate,
MutateFreeze as FunMutateFreeze,
},
fungible::{Inspect, InspectFreeze, Mutate, MutateFreeze},
tokens::{Fortitude, Preservation},
Defensive, DefensiveOption, DefensiveResult, DefensiveSaturating, Get,
},
@@ -408,7 +405,7 @@ pub use weights::WeightInfo;
/// The balance type used by the currency system.
pub type BalanceOf<T> =
<<T as Config>::Currency as FunInspect<<T as frame_system::Config>::AccountId>>::Balance;
<<T as Config>::Currency as Inspect<<T as frame_system::Config>::AccountId>>::Balance;
/// Type used for unique identifier of each pool.
pub type PoolId = u32;
@@ -1608,8 +1605,8 @@ pub mod pallet {
type WeightInfo: weights::WeightInfo;
/// The currency type used for nomination pool.
type Currency: FunMutate<Self::AccountId>
+ FunMutateFreeze<Self::AccountId, Id = Self::RuntimeFreezeReason>;
type Currency: Mutate<Self::AccountId>
+ MutateFreeze<Self::AccountId, Id = Self::RuntimeFreezeReason>;
/// The overarching freeze reason.
type RuntimeFreezeReason: From<FreezeReason>;