Skip to content
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

Merged
merged 10 commits into from
Feb 21, 2024

Conversation

muraca
Copy link
Contributor

@muraca muraca commented Feb 17, 2024

part of #3326

@ggwpez @kianenigma @shawntabrizi

polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp

Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
@muraca muraca requested a review from a team as a code owner February 17, 2024 10:31
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));
Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and yes.

Copy link
Contributor

@kianenigma kianenigma left a 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()?

@muraca
Copy link
Contributor Author

muraca commented Feb 19, 2024

I will, but keep in mind that it's going to be tough to enforce without some kind of linting

@kianenigma
Copy link
Contributor

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};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kianenigma kianenigma added T13-deprecation The current issue/pr is, or should be, part of a deprecation process. R0-silent Changes should not be mentioned in any release notes labels Feb 19, 2024
@kianenigma kianenigma added this pull request to the merge queue Feb 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 19, 2024
@kianenigma kianenigma removed the R0-silent Changes should not be mentioned in any release notes label Feb 19, 2024
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
@muraca muraca changed the title removed pallet::getter from Substrate example pallets removed pallet::getter from example pallets Feb 19, 2024
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
at least you have the proof I'm not an AI

Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
@bkchr bkchr added this pull request to the merge queue Feb 21, 2024
Merged via the queue into paritytech:master with commit cd91c6b Feb 21, 2024
130 checks passed
@liamaharon
Copy link
Contributor

/tip small

Copy link

@liamaharon A referendum for a small (20 DOT) tip was successfully submitted for @muraca (12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp on polkadot).

Referendum number: 578.
tip

Copy link

The referendum has appeared on Polkassembly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T13-deprecation The current issue/pr is, or should be, part of a deprecation process.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants