mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 12:07:57 +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:
@@ -234,7 +234,7 @@ impl<T: Config> Module<T> {
|
||||
return author;
|
||||
}
|
||||
|
||||
let digest = <frame_system::Module<T>>::digest();
|
||||
let digest = <frame_system::Pallet<T>>::digest();
|
||||
let pre_runtime_digests = digest.logs.iter().filter_map(|d| d.as_pre_runtime());
|
||||
if let Some(author) = T::FindAuthor::find_author(pre_runtime_digests) {
|
||||
<Self as Store>::Author::put(&author);
|
||||
@@ -245,7 +245,7 @@ impl<T: Config> Module<T> {
|
||||
}
|
||||
|
||||
fn verify_and_import_uncles(new_uncles: Vec<T::Header>) -> dispatch::DispatchResult {
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let now = <frame_system::Pallet<T>>::block_number();
|
||||
|
||||
let mut uncles = <Self as Store>::Uncles::get();
|
||||
uncles.push(UncleEntryItem::InclusionHeight(now));
|
||||
@@ -278,7 +278,7 @@ impl<T: Config> Module<T> {
|
||||
accumulator: &mut <T::FilterUncle as FilterUncle<T::Header, T::AccountId>>::Accumulator,
|
||||
) -> Result<Option<T::AccountId>, dispatch::DispatchError>
|
||||
{
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let now = <frame_system::Pallet<T>>::block_number();
|
||||
|
||||
let (minimum_height, maximum_height) = {
|
||||
let uncle_generations = T::UncleGenerations::get();
|
||||
@@ -303,7 +303,7 @@ impl<T: Config> Module<T> {
|
||||
|
||||
{
|
||||
let parent_number = uncle.number().clone() - One::one();
|
||||
let parent_hash = <frame_system::Module<T>>::block_hash(&parent_number);
|
||||
let parent_hash = <frame_system::Pallet<T>>::block_hash(&parent_number);
|
||||
if &parent_hash != uncle.parent_hash() {
|
||||
return Err(Error::<T>::InvalidUncleParent.into());
|
||||
}
|
||||
@@ -314,7 +314,7 @@ impl<T: Config> Module<T> {
|
||||
}
|
||||
|
||||
let duplicate = existing_uncles.into_iter().find(|h| **h == hash).is_some();
|
||||
let in_chain = <frame_system::Module<T>>::block_hash(uncle.number()) == hash;
|
||||
let in_chain = <frame_system::Pallet<T>>::block_hash(uncle.number()) == hash;
|
||||
|
||||
if duplicate || in_chain {
|
||||
return Err(Error::<T>::UncleAlreadyIncluded.into())
|
||||
@@ -413,8 +413,8 @@ mod tests {
|
||||
NodeBlock = Block,
|
||||
UncheckedExtrinsic = UncheckedExtrinsic,
|
||||
{
|
||||
System: frame_system::{Module, Call, Config, Storage, Event<T>},
|
||||
Authorship: pallet_authorship::{Module, Call, Storage, Inherent},
|
||||
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
|
||||
Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent},
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user