-
Notifications
You must be signed in to change notification settings - Fork 1.2k
remove pallet::getter from pallet-offences #6027
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
Changes from 1 commit
6c2895b
db1ec46
c6fd425
0a4f3a4
7cb376c
c7d554d
6b03b84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| title: Remove pallet::getter from pallet-offences | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| This PR removes pallet::getter from pallet-offences from type Reports. It also adds a test to verify that retrieval of Reports still works with storage::getter. | ||
|
|
||
| crates: | ||
| - name: pallet-offences | ||
| bump: patch | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,14 +73,28 @@ pub mod pallet { | |
|
|
||
| /// The primary structure that holds all offence records keyed by report identifiers. | ||
| #[pallet::storage] | ||
| #[pallet::getter(fn reports)] | ||
| pub type Reports<T: Config> = StorageMap< | ||
| _, | ||
| Twox64Concat, | ||
| ReportIdOf<T>, | ||
| OffenceDetails<T::AccountId, T::IdentificationTuple>, | ||
| >; | ||
|
|
||
| impl<T: Config> Pallet<T> { | ||
|
seadanda marked this conversation as resolved.
Outdated
|
||
| #[deprecated(note = "Use Reports::<T>::get(id) instead.")] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| pub fn reports<KArg>( | ||
| k: KArg, | ||
| ) -> Option<OffenceDetails<T::AccountId, T::IdentificationTuple>> | ||
| where | ||
| KArg: frame_support::__private::codec::EncodeLike<ReportIdOf<T>>, | ||
|
seadanda marked this conversation as resolved.
Outdated
|
||
| { | ||
| <Reports<T> as frame_support::storage::StorageMap< | ||
| ReportIdOf<T>, | ||
| OffenceDetails<T::AccountId, T::IdentificationTuple>, | ||
| >>::get(k) | ||
|
seadanda marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
|
|
||
| /// A vector of reports of the same kind that happened at the same time slot. | ||
| #[pallet::storage] | ||
| pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap< | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.