frame-support-test: migrate tests from decl_* macros to the new pallet macros (#12445)

* frame-support: migrate some tests from decl macros to new pallet attribute macros

* Remove useless type alias

* Remove useless type alias

* frame-support-test: migrate old decl_macros to new pallet attribute macros

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix features

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove deprecated stuff

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update UI tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix UI test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update UI tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Cleanup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Qinxuan Chen
2023-05-09 17:22:55 +08:00
committed by GitHub
parent 1d42bdf664
commit dcc0858f67
41 changed files with 1139 additions and 2988 deletions
@@ -1,26 +0,0 @@
use frame_support::construct_runtime;
mod pallet_old {
pub trait Config: frame_system::Config {}
decl_storage! {
trait Store for Module<T: Config> as Example {}
}
decl_module! {
pub struct Module<T: Config> for enum Call where origin: T::RuntimeOrigin {}
}
}
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
{
System: frame_system,
OldPallet: pallet_old,
}
}
fn main() {}
@@ -1,31 +0,0 @@
error[E0433]: failed to resolve: could not find `tt_default_parts` in `pallet_old`
--> tests/construct_runtime_ui/old_unsupported_pallet_decl.rs:15:1
|
15 | / construct_runtime! {
16 | | pub struct Runtime where
17 | | UncheckedExtrinsic = UncheckedExtrinsic,
18 | | Block = Block,
... |
23 | | }
24 | | }
| |_^ could not find `tt_default_parts` in `pallet_old`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find macro `decl_storage` in this scope
--> tests/construct_runtime_ui/old_unsupported_pallet_decl.rs:6:2
|
6 | decl_storage! {
| ^^^^^^^^^^^^
|
= help: consider importing this macro:
frame_support::decl_storage
error: cannot find macro `decl_module` in this scope
--> tests/construct_runtime_ui/old_unsupported_pallet_decl.rs:10:2
|
10 | decl_module! {
| ^^^^^^^^^^^
|
= help: consider importing this macro:
frame_support::decl_module
@@ -28,7 +28,9 @@ error[E0412]: cannot find type `Event` in module `pallet`
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this enum
help: consider importing one of these items
|
1 | use frame_support_test::Event;
|
1 | use frame_system::Event;
|
@@ -28,7 +28,9 @@ error[E0412]: cannot find type `Origin` in module `pallet`
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this type alias
help: consider importing one of these items
|
1 | use frame_support_test::Origin;
|
1 | use frame_system::Origin;
|