mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
Replace 'Module' with 'Pallet' in construct_runtime macro (#8372)
* Use 'Pallet' struct in construct_runtime. * Fix genesis and metadata macro. * Fix 'Pallet' type alias. * Replace 'Module' with 'Pallet' for all construct_runtime use cases. * Replace more deprecated 'Module' struct. * Bring back AllModules and AllPalletsWithSystem type, but deprecate them. * Replace deprecated 'Module' struct from merge master. * Minor fix. * Fix UI tests. * Revert UI override in derive_no_bound. * Fix more deprecated 'Module' use from master branch. * Fix more deprecated 'Module' use from master branch.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
use super::*;
|
||||
|
||||
use frame_system::{RawOrigin, Module as System};
|
||||
use frame_system::{RawOrigin, Pallet as System};
|
||||
use frame_benchmarking::{benchmarks, account, whitelisted_caller, impl_benchmark_test_suite};
|
||||
use sp_runtime::traits::Bounded;
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ impl<T: Config> Module<T> {
|
||||
/// current unvested amount.
|
||||
fn update_lock(who: T::AccountId) -> DispatchResult {
|
||||
let vesting = Self::vesting(&who).ok_or(Error::<T>::NotVesting)?;
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let now = <frame_system::Pallet<T>>::block_number();
|
||||
let locked_now = vesting.locked_at::<T::BlockNumberToBalance>(now);
|
||||
|
||||
if locked_now.is_zero() {
|
||||
@@ -339,7 +339,7 @@ impl<T: Config> VestingSchedule<T::AccountId> for Module<T> where
|
||||
/// Get the amount that is currently being vested and cannot be transferred out of this account.
|
||||
fn vesting_balance(who: &T::AccountId) -> Option<BalanceOf<T>> {
|
||||
if let Some(v) = Self::vesting(who) {
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let now = <frame_system::Pallet<T>>::block_number();
|
||||
let locked_now = v.locked_at::<T::BlockNumberToBalance>(now);
|
||||
Some(T::Currency::free_balance(who).min(locked_now))
|
||||
} else {
|
||||
@@ -408,9 +408,9 @@ mod tests {
|
||||
NodeBlock = Block,
|
||||
UncheckedExtrinsic = UncheckedExtrinsic,
|
||||
{
|
||||
System: frame_system::{Module, Call, Config, Storage, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
|
||||
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
|
||||
Vesting: pallet_vesting::{Pallet, Call, Storage, Event<T>, Config<T>},
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user