-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Migrate remaining old decl_* macros to the new pallet attribute macros #12271
Migrate remaining old decl_* macros to the new pallet attribute macros #12271
Conversation
Signed-off-by: koushiro <[email protected]>
@@ -36,7 +36,7 @@ mod pallet_test { | |||
|
|||
#[pallet::pallet] | |||
#[pallet::generate_store(pub(super) trait Store)] | |||
pub struct Pallet<T>(_); | |||
pub struct Pallet<T>(PhantomData<T>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub struct Pallet<T>(PhantomData<T>); | |
pub struct Pallet<T>(_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use struct Pallet<T>(PhantomData<T>);
?
struct Pallet<T>(_);
is not standard rust syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know. This syntax was added as some shortcut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would not be against removing these shortcuts if you find it confusing. End of the day, no one writes this line by hand, they just copy some template.
Signed-off-by: koushiro <[email protected]>
Signed-off-by: koushiro <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI isn't happy, but looks good otherwise!
Ty
@KiChjang @shawntabrizi PTAL |
@koushiro tests are still failing. |
Signed-off-by: koushiro <[email protected]>
Signed-off-by: koushiro <[email protected]>
Fixed |
By the end of this PR, we should have no more use of |
bot rebase |
Error: Command 'Command { std: "git" "merge" "origin/master" "--no-ff" "--no-edit", kill_on_drop: false }' failed with status Some(1); output: no output |
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Statuses failed for eee38f7 |
/tip small |
@kianenigma A small tip was successfully submitted for koushiro (15XuanNimo5951s3RjFTPX1AvYVnCwfr3SDhb3AV4fQF3LpK on polkadot). https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/treasury/tips |
bot merge |
Waiting for commit status. |
* master: [Fix] parameter_types! dead code errors (#12340) [Feature] Sequential migration execution for try-runtime (#12319) bench: Use `_` instead of `::` in auto-generated file names (#12332) Fast Unstake Pallet (#12129) Rename anonymous to pure proxy (#12283) Migrate remaining old decl_* macros to the new pallet attribute macros (#12271) pallet-utility: Disallow none origin (#12321) Make automatic storage deposits resistant against changing deposit prices (#12083) Format templates and fix `--steps` default value (#12286) Bump `wasmtime` to 1.0.0 (#12317) Introduce 'intermediate_insert' method to hide implementation details (#12215) Bound staking storage items (#12230) Use `array-bytes` for All Array/Bytes/Hex Operations (#12190) BREAKING: Rename Origin (#12258) Use temporary db for benchmarking (#12254) rpc: Implement `chainSpec` RPC API (#12261) Import target block body during warp sync (#12300) Proper naming wrt expectations (#12311) [ci] Revert cancel-pipeline job (#12309)
paritytech#12271) * Migrate remaining old decl_* macros to the new pallet attribute macros Signed-off-by: koushiro <[email protected]> * Apply review suggestions Signed-off-by: koushiro <[email protected]> * Apply review suggestions Signed-off-by: koushiro <[email protected]> * use pallet::storage * Fix dev rpc test Signed-off-by: koushiro <[email protected]> * Fix service tests Signed-off-by: koushiro <[email protected]> Signed-off-by: koushiro <[email protected]>
What does it do?
Migrate remaining old
decl_
* macros to the new#[pallet]
attribute macrospart of #12248
polkadot address: 15XuanNimo5951s3RjFTPX1AvYVnCwfr3SDhb3AV4fQF3LpK