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
+5 -5
View File
@@ -394,7 +394,7 @@ pub mod pallet {
let announcement = Announcement {
real: real.clone(),
call_hash: call_hash.clone(),
height: system::Module::<T>::block_number(),
height: system::Pallet::<T>::block_number(),
};
Announcements::<T>::try_mutate(&who, |(ref mut pending, ref mut deposit)| {
@@ -510,7 +510,7 @@ pub mod pallet {
let def = Self::find_proxy(&real, &delegate, force_proxy_type)?;
let call_hash = T::CallHasher::hash_of(&call);
let now = system::Module::<T>::block_number();
let now = system::Pallet::<T>::block_number();
Self::edit_announcements(&delegate, |ann|
ann.real != real || ann.call_hash != call_hash || now.saturating_sub(ann.height) < def.delay
).map_err(|_| Error::<T>::Unannounced)?;
@@ -584,7 +584,7 @@ pub mod pallet {
}
impl<T: Config> Module<T> {
impl<T: Config> Pallet<T> {
/// Calculate the address of an anonymous account.
///
@@ -604,8 +604,8 @@ impl<T: Config> Module<T> {
maybe_when: Option<(T::BlockNumber, u32)>,
) -> T::AccountId {
let (height, ext_index) = maybe_when.unwrap_or_else(|| (
system::Module::<T>::block_number(),
system::Module::<T>::extrinsic_index().unwrap_or_default()
system::Pallet::<T>::block_number(),
system::Pallet::<T>::extrinsic_index().unwrap_or_default()
));
let entropy = (b"modlpy/proxy____", who, height, ext_index, proxy_type, index)
.using_encoded(blake2_256);