mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
Implements pallet versioning (#7208)
* Start * Make macro work * Rename `ModuleToIndex` to `PalletRuntimeSetup` Besides the renaming it also adds support getting the name of a pallet as configured in the runtime. * Rename it to `PalletInfo` * Remove accidentally added files * Some work * Make everything compile * Adds a test and fixes some bugs * Implement ordering for `PalletVersion` * Apply suggestions from code review * Review feedback * Update frame/support/src/dispatch.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Update frame/support/src/dispatch.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Fix compilation * Fix test * Fix doc test Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -4,10 +4,7 @@ macro_rules! reserved {
|
||||
mod $reserved {
|
||||
pub use frame_support::dispatch;
|
||||
|
||||
pub trait Trait {
|
||||
type Origin;
|
||||
type BlockNumber: Into<u32>;
|
||||
}
|
||||
pub trait Trait: frame_support_test::Trait {}
|
||||
|
||||
pub mod system {
|
||||
use frame_support::dispatch;
|
||||
@@ -18,7 +15,7 @@ macro_rules! reserved {
|
||||
}
|
||||
|
||||
frame_support::decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=frame_support_test {
|
||||
#[weight = 0]
|
||||
fn $reserved(_origin) -> dispatch::DispatchResult { unreachable!() }
|
||||
}
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
error: Invalid call fn name: `on_finalize`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
|
||||
--> $DIR/on_initialize.rs:31:1
|
||||
--> $DIR/on_initialize.rs:28:1
|
||||
|
|
||||
31 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: Invalid call fn name: `on_initialize`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
|
||||
--> $DIR/on_initialize.rs:31:1
|
||||
--> $DIR/on_initialize.rs:28:1
|
||||
|
|
||||
31 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: Invalid call fn name: `on_runtime_upgrade`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
|
||||
--> $DIR/on_initialize.rs:31:1
|
||||
--> $DIR/on_initialize.rs:28:1
|
||||
|
|
||||
31 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: Invalid call fn name: `offchain_worker`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
|
||||
--> $DIR/on_initialize.rs:31:1
|
||||
--> $DIR/on_initialize.rs:28:1
|
||||
|
|
||||
31 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: Invalid call fn name: `deposit_event`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
|
||||
--> $DIR/on_initialize.rs:31:1
|
||||
--> $DIR/on_initialize.rs:28:1
|
||||
|
|
||||
31 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
Reference in New Issue
Block a user