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:
Shaun Wang
2021-03-18 21:50:08 +13:00
committed by GitHub
parent 05f24931a9
commit 2e5522444a
157 changed files with 881 additions and 864 deletions
+3 -3
View File
@@ -793,7 +793,7 @@ decl_module! {
let mut payouts = <Payouts<T, I>>::get(&who);
if let Some((when, amount)) = payouts.first() {
if when <= &<system::Module<T>>::block_number() {
if when <= &<system::Pallet<T>>::block_number() {
T::Currency::transfer(&Self::payouts(), &who, *amount, AllowDeath)?;
payouts.remove(0);
if payouts.is_empty() {
@@ -981,7 +981,7 @@ decl_module! {
// Reduce next pot by payout
<Pot<T, I>>::put(pot - value);
// Add payout for new candidate
let maturity = <system::Module<T>>::block_number()
let maturity = <system::Pallet<T>>::block_number()
+ Self::lock_duration(Self::members().len() as u32);
Self::pay_accepted_candidate(&who, value, kind, maturity);
}
@@ -1324,7 +1324,7 @@ impl<T: Config<I>, I: Instance> Module<T, I> {
// critical issues or side-effects. This is auto-correcting as members fall out of society.
members.reserve(candidates.len());
let maturity = <system::Module<T>>::block_number()
let maturity = <system::Pallet<T>>::block_number()
+ Self::lock_duration(members.len() as u32);
let mut rewardees = Vec::new();
+4 -4
View File
@@ -41,9 +41,9 @@ frame_support::construct_runtime!(
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
Society: pallet_society::{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>},
Society: pallet_society::{Pallet, Call, Storage, Event<T>, Config<T>},
}
);
@@ -104,7 +104,7 @@ impl pallet_balances::Config for Test {
impl Config for Test {
type Event = Event;
type Currency = pallet_balances::Module<Self>;
type Currency = pallet_balances::Pallet<Self>;
type Randomness = TestRandomness<Self>;
type CandidateDeposit = CandidateDeposit;
type WrongSideDeduction = WrongSideDeduction;