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
@@ -1,10 +1,10 @@
error: Module indices are conflicting: Both modules System and Pallet1 are at index 0
error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0
--> $DIR/conflicting_index.rs:9:3
|
9 | System: system::{},
| ^^^^^^
error: Module indices are conflicting: Both modules System and Pallet1 are at index 0
error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0
--> $DIR/conflicting_index.rs:10:3
|
10 | Pallet1: pallet1::{} = 0,
@@ -1,10 +1,10 @@
error: Module indices are conflicting: Both modules System and Pallet3 are at index 5
error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5
--> $DIR/conflicting_index_2.rs:9:3
|
9 | System: system::{} = 5,
| ^^^^^^
error: Module indices are conflicting: Both modules System and Pallet3 are at index 5
error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5
--> $DIR/conflicting_index_2.rs:12:3
|
12 | Pallet3: pallet3::{},
@@ -6,9 +6,9 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module},
Balance: balances::{Module},
Balance: balances::{Module},
System: system::{Pallet},
Balance: balances::{Pallet},
Balance: balances::{Pallet},
}
}
@@ -1,11 +1,11 @@
error: Two modules with the same name!
error: Two pallets with the same name!
--> $DIR/conflicting_module_name.rs:10:3
|
10 | Balance: balances::{Module},
10 | Balance: balances::{Pallet},
| ^^^^^^^
error: Two modules with the same name!
error: Two pallets with the same name!
--> $DIR/conflicting_module_name.rs:11:3
|
11 | Balance: balances::{Module},
11 | Balance: balances::{Pallet},
| ^^^^^^^
@@ -6,7 +6,7 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module},
System: system::{Pallet},
Balance: balances::{Config, Call, Config<T>, Origin<T>},
}
}
@@ -6,7 +6,7 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module},
System: system::{Pallet},
Balance: balances::<Instance1>::{Call<T>, Origin<T>},
}
}
@@ -1,4 +1,4 @@
error: `Call` is not allowed to have generics. Only the following modules are allowed to have generics: `Event`, `Origin`, `Config`.
error: `Call` is not allowed to have generics. Only the following pallets are allowed to have generics: `Event`, `Origin`, `Config`.
--> $DIR/generics_in_invalid_module.rs:10:36
|
10 | Balance: balances::<Instance1>::{Call<T>, Origin<T>},
@@ -1,4 +1,4 @@
error: expected one of: `Module`, `Call`, `Storage`, `Event`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`
error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`
--> $DIR/invalid_module_details_keyword.rs:9:20
|
9 | system: System::{enum},
@@ -6,7 +6,7 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module},
System: system::{Pallet},
Balance: balances::{Error},
}
}
@@ -1,4 +1,4 @@
error: expected one of: `Module`, `Call`, `Storage`, `Event`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`
error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`
--> $DIR/invalid_module_entry.rs:10:23
|
10 | Balance: balances::{Error},
@@ -6,7 +6,7 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module},
System: system::{Pallet},
Balance: balances::<Instance1>::{Event},
}
}
@@ -1,4 +1,4 @@
error: Instantiable module with no generic `Event` cannot be constructed: module `Balance` must have generic `Event`
error: Instantiable pallet with no generic `Event` cannot be constructed: pallet `Balance` must have generic `Event`
--> $DIR/missing_event_generic_on_module_with_instance.rs:10:3
|
10 | Balance: balances::<Instance1>::{Event},
@@ -6,7 +6,7 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module},
System: system::{Pallet},
Balance: balances::<Instance1>::{Origin},
}
}
@@ -1,4 +1,4 @@
error: Instantiable module with no generic `Origin` cannot be constructed: module `Balance` must have generic `Origin`
error: Instantiable pallet with no generic `Origin` cannot be constructed: pallet `Balance` must have generic `Origin`
--> $DIR/missing_origin_generic_on_module_with_instance.rs:10:3
|
10 | Balance: balances::<Instance1>::{Origin},
@@ -1,4 +1,4 @@
error: `System` module declaration is missing. Please add this line: `System: frame_system::{Module, Call, Storage, Config, Event<T>},`
error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event<T>},`
--> $DIR/missing_system_module.rs:8:2
|
8 | {
@@ -1,4 +1,4 @@
error: Module index doesn't fit into u8, index is 256
error: Pallet index doesn't fit into u8, index is 256
--> $DIR/more_than_256_modules.rs:10:3
|
10 | Pallet256: pallet256::{},