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
+5 -5
View File
@@ -84,8 +84,8 @@ use frame_support::{
pallet_prelude::*,
traits::{
fungible::{
hold::{Inspect as FunHoldInspect, Mutate as FunHoldMutate},
Inspect as FunInspect,
self,
hold::{Inspect, Mutate},
},
tokens::{Fortitude, Precision},
CallMetadata, Contains, Defensive, GetCallMetadata, PalletInfoAccess, SafeModeNotify,
@@ -102,7 +102,7 @@ pub use pallet::*;
pub use weights::*;
type BalanceOf<T> =
<<T as Config>::Currency as FunInspect<<T as frame_system::Config>::AccountId>>::Balance;
<<T as Config>::Currency as fungible::Inspect<<T as frame_system::Config>::AccountId>>::Balance;
#[frame_support::pallet]
pub mod pallet {
@@ -117,8 +117,8 @@ pub mod pallet {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Currency type for this pallet, used for Deposits.
type Currency: FunHoldInspect<Self::AccountId>
+ FunHoldMutate<Self::AccountId, Reason = Self::RuntimeHoldReason>;
type Currency: Inspect<Self::AccountId>
+ Mutate<Self::AccountId, Reason = Self::RuntimeHoldReason>;
/// The hold reason when reserving funds for entering or extending the safe-mode.
type RuntimeHoldReason: From<HoldReason>;