-
Notifications
You must be signed in to change notification settings - Fork 782
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
remove pallet::getter from pallet-offences #6027
Conversation
6d121c6
to
b74ddc3
Compare
Yeah, we need you to create a new public function which does the same thing as the getter here. |
92b3ceb
to
6c2895b
Compare
substrate/frame/offences/src/lib.rs
Outdated
pub type Reports<T: Config> = StorageMap< | ||
_, | ||
Twox64Concat, | ||
ReportIdOf<T>, | ||
OffenceDetails<T::AccountId, T::IdentificationTuple>, | ||
>; | ||
|
||
impl<T: Config> Pallet<T> { | ||
#[deprecated(note = "Use Reports::<T>::get(id) instead.")] |
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.
but there is no need to deprecate here.
Just keep this public function around forever. The point is just to remove the macro code/logic, not necessarily remove this functionality.
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.
Ah that was my request - that was the impression that I got from the discussion on the issue, maybe I'm not up to date on the intention behind removing the getters
I think we can approved after you integrate our final feedback here. thanks! |
Please include your polkadot address in your pr description: /~https://github.com/paritytech/substrate-tip-bot |
Review required! Latest push from author must always be reviewed |
Alright, everything done from your feedback, I'd say. Thanks guys! |
/// Get the offence details from reports of given ID. | ||
pub fn reports( | ||
report_id: ReportIdOf<T>, | ||
) -> Option<OffenceDetails<T::AccountId, T::IdentificationTuple>> { | ||
Reports::<T>::get(report_id) | ||
} | ||
|
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.
great, this is really all you need to do :)
Looking forward to seeing more contributions
/tip small |
@shawntabrizi A referendum for a small (20 DOT) tip was successfully submitted for @Zebedeusz (155YyFVoMnv9BY6qxy2i5wxtveUw7WE1n5H81fL8PZKTA1Sd on polkadot). |
Description
Part of #3326
Removes pallet::getter from pallet-offences from type
Reports
.Adds a test to verify that retrieval of
Reports
still works with storage::getter.polkadot address: 155YyFVoMnv9BY6qxy2i5wxtveUw7WE1n5H81fL8PZKTA1Sd