mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
BREAKING: Rename Call & Event (#11981)
* rename Event to RuntimeEvent * rename Call * rename in runtimes * small fix * rename Event * small fix & rename RuntimeCall back to Call for now * small fixes * more renaming * a bit more renaming * fmt * small fix * commit * prep for renaming associated types * fix * rename associated Event type * rename to RuntimeEvent * commit * merge conflict fixes & fmt * additional renaming * fix. * fix decl_event * rename in tests * remove warnings * remove accidental rename * . * commit * update .stderr * fix in test * update .stderr * TRYBUILD=overwrite * docs * fmt * small change in docs * rename PalletEvent to Event * rename Call to RuntimeCall * renamed at wrong places :P * rename Call * rename * rename associated type * fix * fix & fmt * commit * frame-support-test * passing tests * update docs * rustdoc fix * update .stderr * wrong code in docs * merge fix * fix in error message * update .stderr * docs & error message * . * merge fix * merge fix * fmt * fmt * merge fix * more fixing * fmt * remove unused * fmt * fix Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u64;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
|
||||
+8
-17
@@ -1,28 +1,19 @@
|
||||
error: Unexpected tokens, expected one of `=`, `,`
|
||||
--> $DIR/both_use_and_excluded_parts.rs:29:43
|
||||
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:29:43
|
||||
|
|
||||
29 | Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0412]: cannot find type `Call` in this scope
|
||||
--> $DIR/both_use_and_excluded_parts.rs:18:64
|
||||
|
|
||||
18 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
1 | use crate::pallet::Call;
|
||||
|
|
||||
1 | use frame_support_test::Call;
|
||||
|
|
||||
1 | use frame_system::Call;
|
||||
|
|
||||
1 | use test_pallet::Call;
|
||||
error[E0412]: cannot find type `RuntimeCall` in this scope
|
||||
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:18:64
|
||||
|
|
||||
18 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
| - ^^^^^^^^^^^ not found in this scope
|
||||
| |
|
||||
| help: you might be missing a type parameter: `<RuntimeCall>`
|
||||
|
||||
error[E0412]: cannot find type `Runtime` in this scope
|
||||
--> $DIR/both_use_and_excluded_parts.rs:20:25
|
||||
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:20:25
|
||||
|
|
||||
20 | impl pallet::Config for Runtime {}
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
||||
@@ -20,7 +20,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u64;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
|
||||
+8
-17
@@ -1,28 +1,19 @@
|
||||
error: Invalid pallet part specified, the pallet `Pallet` doesn't have the `Call` part. Available parts are: `Pallet`, `Storage`.
|
||||
--> $DIR/exclude_undefined_part.rs:34:34
|
||||
--> tests/construct_runtime_ui/exclude_undefined_part.rs:34:34
|
||||
|
|
||||
34 | Pallet: pallet exclude_parts { Call },
|
||||
| ^^^^
|
||||
|
||||
error[E0412]: cannot find type `Call` in this scope
|
||||
--> $DIR/exclude_undefined_part.rs:23:64
|
||||
|
|
||||
23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
1 | use crate::pallet::Call;
|
||||
|
|
||||
1 | use frame_support_test::Call;
|
||||
|
|
||||
1 | use frame_system::Call;
|
||||
|
|
||||
1 | use test_pallet::Call;
|
||||
error[E0412]: cannot find type `RuntimeCall` in this scope
|
||||
--> tests/construct_runtime_ui/exclude_undefined_part.rs:23:64
|
||||
|
|
||||
23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
| - ^^^^^^^^^^^ not found in this scope
|
||||
| |
|
||||
| help: you might be missing a type parameter: `<RuntimeCall>`
|
||||
|
||||
error[E0412]: cannot find type `Runtime` in this scope
|
||||
--> $DIR/exclude_undefined_part.rs:25:25
|
||||
--> tests/construct_runtime_ui/exclude_undefined_part.rs:25:25
|
||||
|
|
||||
25 | impl pallet::Config for Runtime {}
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
||||
@@ -6,7 +6,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl test_pallet::Config for Runtime {}
|
||||
|
||||
@@ -15,13 +15,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
@@ -40,7 +40,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -49,13 +49,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -24,13 +24,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -24,13 +24,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
@@ -45,36 +45,3 @@ help: if you import `Event`, refer to it directly
|
||||
57 - }
|
||||
58 - }
|
||||
|
|
||||
|
||||
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
|
||||
51 | | Block = Block,
|
||||
52 | | NodeBlock = Block,
|
||||
... |
|
||||
57 | | }
|
||||
58 | | }
|
||||
| |_^ 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 one of these items
|
||||
|
|
||||
1 | use crate::Event;
|
||||
|
|
||||
1 | use frame_system::Event;
|
||||
|
|
||||
help: if you import `Event`, refer to it directly
|
||||
|
|
||||
49 - construct_runtime! {
|
||||
50 - pub enum Runtime where
|
||||
51 - Block = Block,
|
||||
52 - NodeBlock = Block,
|
||||
53 - UncheckedExtrinsic = UncheckedExtrinsic
|
||||
54 - {
|
||||
55 - System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
|
||||
56 - Pallet: pallet::{Pallet, Event},
|
||||
57 - }
|
||||
58 - }
|
||||
|
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -24,13 +24,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -24,13 +24,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -24,13 +24,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u32;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
@@ -24,13 +24,13 @@ impl frame_system::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u32;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = sp_runtime::testing::H256;
|
||||
type Hashing = sp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = frame_support::traits::ConstU32<250>;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
|
||||
+2
-2
@@ -15,14 +15,14 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you
|
||||
|
|
||||
= note: this error originates in the macro `pallet::__substrate_validate_unsigned_check::is_validate_unsigned_part_defined` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0599]: no variant or associated item named `Pallet` found for enum `Call` in the current scope
|
||||
error[E0599]: no variant or associated item named `Pallet` found for enum `RuntimeCall` in the current scope
|
||||
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:56:3
|
||||
|
|
||||
49 | construct_runtime! {
|
||||
| ------------------ variant or associated item `Pallet` not found here
|
||||
...
|
||||
56 | Pallet: pallet::{Pallet, ValidateUnsigned},
|
||||
| ^^^^^^ variant or associated item not found in `Call`
|
||||
| ^^^^^^ variant or associated item not found in `RuntimeCall`
|
||||
|
||||
error[E0599]: no function or associated item named `pre_dispatch` found for struct `pallet::Pallet` in the current scope
|
||||
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:49:1
|
||||
|
||||
@@ -20,7 +20,7 @@ pub type Signature = sr25519::Signature;
|
||||
pub type BlockNumber = u64;
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
|
||||
|
||||
@@ -1,28 +1,19 @@
|
||||
error: Invalid pallet part specified, the pallet `Pallet` doesn't have the `Call` part. Available parts are: `Pallet`, `Storage`.
|
||||
--> $DIR/use_undefined_part.rs:34:30
|
||||
--> tests/construct_runtime_ui/use_undefined_part.rs:34:30
|
||||
|
|
||||
34 | Pallet: pallet use_parts { Call },
|
||||
| ^^^^
|
||||
|
||||
error[E0412]: cannot find type `Call` in this scope
|
||||
--> $DIR/use_undefined_part.rs:23:64
|
||||
|
|
||||
23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
1 | use crate::pallet::Call;
|
||||
|
|
||||
1 | use frame_support_test::Call;
|
||||
|
|
||||
1 | use frame_system::Call;
|
||||
|
|
||||
1 | use test_pallet::Call;
|
||||
error[E0412]: cannot find type `RuntimeCall` in this scope
|
||||
--> tests/construct_runtime_ui/use_undefined_part.rs:23:64
|
||||
|
|
||||
23 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
|
||||
| - ^^^^^^^^^^^ not found in this scope
|
||||
| |
|
||||
| help: you might be missing a type parameter: `<RuntimeCall>`
|
||||
|
||||
error[E0412]: cannot find type `Runtime` in this scope
|
||||
--> $DIR/use_undefined_part.rs:25:25
|
||||
--> tests/construct_runtime_ui/use_undefined_part.rs:25:25
|
||||
|
|
||||
25 | impl pallet::Config for Runtime {}
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
||||
Reference in New Issue
Block a user