-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removed pallet::getter
from example pallets
#3371
Conversation
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
@@ -9,7 +9,7 @@ fn it_works_for_default_value() { | |||
// Dispatch a signed extrinsic. | |||
assert_ok!(TemplateModule::do_something(RuntimeOrigin::signed(1), 42)); | |||
// Read pallet storage and assert an expected result. | |||
assert_eq!(TemplateModule::something(), Some(42)); | |||
assert_eq!(<Something<Test>>::get(), Some(42)); |
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.
Im not sure if we settled on a preferred syntax, this turbofish vs ::
.
Personally i think ::
everywhere is better, but without linter it will probably not work out anyway.
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 agree that Something::<Test>::get()
is preferred
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.
Yes and yes.
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.
@muraca can you in general in this migration encourage the use of Type::<T>::foo()
over <Type<T>>::foo()
?
I will, but keep in mind that it's going to be tough to enforce without some kind of linting |
Let's do the best we can in manual reviews, but indeed it is not a strict rule. Thanks! |
@@ -1,4 +1,4 @@ | |||
use crate::{mock::*, Error, Event}; | |||
use crate::{mock::*, Error, Event, Something}; |
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.
Can you update https://github.com/substrate-developer-hub/substrate-node-template as well? see #3155
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
pallet::getter
from Substrate example palletspallet::getter
from example pallets
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
ec96fb2
to
835ae80
Compare
at least you have the proof I'm not an AI Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
/tip small |
@liamaharon A referendum for a small (20 DOT) tip was successfully submitted for @muraca (12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp on polkadot). |
The referendum has appeared on Polkassembly. |
part of paritytech#3326 @ggwpez @kianenigma @shawntabrizi --------- Signed-off-by: Matteo Muraca <mmuraca247@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
part of #3326
@ggwpez @kianenigma @shawntabrizi
polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp