This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removes call_index * Adds UI test and updates doc * Update frame/examples/dev-mode/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * Update frame/examples/dev-mode/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]>
- Loading branch information
Showing
4 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
pub use pallet::*; | ||
|
||
#[frame_support::pallet] | ||
pub mod pallet { | ||
use frame_support::pallet_prelude::*; | ||
use frame_system::pallet_prelude::OriginFor; | ||
|
||
// The struct on which we build all of our Pallet logic. | ||
#[pallet::pallet] | ||
pub struct Pallet<T>(_); | ||
|
||
// Your Pallet's configuration trait, representing custom external types and interfaces. | ||
#[pallet::config] | ||
pub trait Config: frame_system::Config {} | ||
|
||
// Your Pallet's callable functions. | ||
#[pallet::call] | ||
impl<T: Config> Pallet<T> { | ||
#[pallet::weight(0)] | ||
pub fn my_call(_origin: OriginFor<T>) -> DispatchResult { | ||
Ok(()) | ||
} | ||
} | ||
|
||
// Your Pallet's internal functions. | ||
impl<T: Config> Pallet<T> {} | ||
} | ||
|
||
fn main() {} |
24 changes: 24 additions & 0 deletions
24
frame/support/test/tests/pallet_ui/dev_mode_without_arg_call_index.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_0::_w`: | ||
It is deprecated to use implicit call indices. | ||
Please instead ensure that all calls have a `pallet::call_index` attribute or put the pallet into `dev` mode. | ||
|
||
For more info see: | ||
<https://github.com/paritytech/substrate/pull/12891> | ||
<https://github.com/paritytech/substrate/pull/11381> | ||
--> tests/pallet_ui/dev_mode_without_arg_call_index.rs:22:10 | ||
| | ||
22 | pub fn my_call(_origin: OriginFor<T>) -> DispatchResult { | ||
| ^^^^^^^ | ||
| | ||
= note: `-D deprecated` implied by `-D warnings` | ||
|
||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: | ||
It is deprecated to use hard-coded constant as call weight. | ||
Please instead benchmark all calls or put the pallet into `dev` mode. | ||
|
||
For more info see: | ||
<https://github.com/paritytech/substrate/pull/13798> | ||
--> tests/pallet_ui/dev_mode_without_arg_call_index.rs:21:20 | ||
| | ||
21 | #[pallet::weight(0)] | ||
| ^ |