Pub enum runtime to pub struct runtime (#13250)

* pub enum Runtime -> pub struct Runtime

* changing some more

* fmt

* updating *.stderr files

* re-run trybuild after rust update

* keep a test file for `pub enum Runtime`

* Delete construct_runtime_2.rs

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
This commit is contained in:
afm
2023-03-07 08:14:12 -03:00
committed by GitHub
parent c5b6649ecc
commit d86a32630b
73 changed files with 99 additions and 96 deletions
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
Block = Block1,
@@ -20,7 +20,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
@@ -25,7 +25,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
TypeX = Block,
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime {}
pub struct Runtime {}
}
fn main() {}
@@ -1,5 +1,5 @@
error: expected `where`
--> tests/construct_runtime_ui/missing_where_block.rs:4:19
--> tests/construct_runtime_ui/missing_where_block.rs:4:21
|
4 | pub enum Runtime {}
| ^
4 | pub struct Runtime {}
| ^
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
{}
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic
Block = Block,
NodeBlock = Block,
@@ -38,7 +38,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -2,7 +2,7 @@ error: `Pallet` does not have the std feature enabled, this will cause the `test
--> tests/construct_runtime_ui/no_std_genesis_config.rs:40:1
|
40 | / construct_runtime! {
41 | | pub enum Runtime where
41 | | pub struct Runtime where
42 | | Block = Block,
43 | | NodeBlock = Block,
... |
@@ -16,7 +16,7 @@ error[E0412]: cannot find type `GenesisConfig` in crate `test_pallet`
--> tests/construct_runtime_ui/no_std_genesis_config.rs:40:1
|
40 | / construct_runtime! {
41 | | pub enum Runtime where
41 | | pub struct Runtime where
42 | | Block = Block,
43 | | NodeBlock = Block,
... |
@@ -34,7 +34,7 @@ error[E0283]: type annotations needed
--> tests/construct_runtime_ui/no_std_genesis_config.rs:40:1
|
40 | / construct_runtime! {
41 | | pub enum Runtime where
41 | | pub struct Runtime where
42 | | Block = Block,
43 | | NodeBlock = Block,
... |
@@ -13,7 +13,7 @@ mod pallet_old {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
@@ -1,8 +1,8 @@
error[E0433]: failed to resolve: could not find `tt_default_parts` in `pallet_old`
--> $DIR/old_unsupported_pallet_decl.rs:15:1
--> tests/construct_runtime_ui/old_unsupported_pallet_decl.rs:15:1
|
15 | / construct_runtime! {
16 | | pub enum Runtime where
16 | | pub struct Runtime where
17 | | UncheckedExtrinsic = UncheckedExtrinsic,
18 | | Block = Block,
... |
@@ -13,7 +13,7 @@ error[E0433]: failed to resolve: could not find `tt_default_parts` in `pallet_ol
= 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
--> $DIR/old_unsupported_pallet_decl.rs:6:2
--> tests/construct_runtime_ui/old_unsupported_pallet_decl.rs:6:2
|
6 | decl_storage! {
| ^^^^^^^^^^^^
@@ -22,7 +22,7 @@ error: cannot find macro `decl_storage` in this scope
frame_support::decl_storage
error: cannot find macro `decl_module` in this scope
--> $DIR/old_unsupported_pallet_decl.rs:10:2
--> tests/construct_runtime_ui/old_unsupported_pallet_decl.rs:10:2
|
10 | decl_module! {
| ^^^^^^^^^^^
@@ -72,7 +72,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> tests/construct_runtime_ui/pallet_error_too_large.rs:74:1
|
74 | / construct_runtime! {
75 | | pub enum Runtime where
75 | | pub struct Runtime where
76 | | Block = Block,
77 | | NodeBlock = Block,
... |
@@ -47,7 +47,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -5,7 +5,7 @@ error: `Pallet` does not have #[pallet::call] defined, perhaps you should remove
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -47,7 +47,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -5,7 +5,7 @@ error: `Pallet` does not have #[pallet::event] defined, perhaps you should remov
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -19,7 +19,7 @@ error[E0412]: cannot find type `Event` in module `pallet`
--> tests/construct_runtime_ui/undefined_event_part.rs:49:1
|
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -47,7 +47,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -5,7 +5,7 @@ error: `Pallet` does not have #[pallet::genesis_config] defined, perhaps you sho
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -19,7 +19,7 @@ error[E0412]: cannot find type `GenesisConfig` in module `pallet`
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:49:1
|
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -37,7 +37,7 @@ error[E0283]: type annotations needed
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:49:1
|
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -47,7 +47,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -5,7 +5,7 @@ error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should re
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -22,7 +22,7 @@ error[E0599]: no function or associated item named `create_inherent` found for s
| -------------------- function or associated item `create_inherent` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -42,7 +42,7 @@ error[E0599]: no function or associated item named `is_inherent` found for struc
| -------------------- function or associated item `is_inherent` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -62,7 +62,7 @@ error[E0599]: no function or associated item named `check_inherent` found for st
| -------------------- function or associated item `check_inherent` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -82,7 +82,7 @@ error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `p
| -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -102,7 +102,7 @@ error[E0599]: no function or associated item named `is_inherent_required` found
| -------------------- function or associated item `is_inherent_required` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -47,7 +47,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -5,7 +5,7 @@ error: `Pallet` does not have #[pallet::origin] defined, perhaps you should remo
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -19,7 +19,7 @@ error[E0412]: cannot find type `Origin` in module `pallet`
--> tests/construct_runtime_ui/undefined_origin_part.rs:49:1
|
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -37,7 +37,7 @@ error[E0282]: type annotations needed
--> tests/construct_runtime_ui/undefined_origin_part.rs:49:1
|
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -47,7 +47,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -5,7 +5,7 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -19,7 +19,7 @@ error[E0599]: no variant or associated item named `Pallet` found for enum `Runti
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:56:3
|
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -36,7 +36,7 @@ error[E0599]: no function or associated item named `pre_dispatch` found for stru
| -------------------- function or associated item `pre_dispatch` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -57,7 +57,7 @@ error[E0599]: no function or associated item named `validate_unsigned` found for
| -------------------- function or associated item `validate_unsigned` not found for this struct
...
49 | / construct_runtime! {
50 | | pub enum Runtime where
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -1,7 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
@@ -25,7 +25,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
construct_runtime! {
pub enum Runtime where
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic