Skip to content

Commit

Permalink
Remove pallet::getter usage from authority-discovery pallet (parity…
Browse files Browse the repository at this point in the history
…tech#4091)

As per paritytech#3326, removes pallet::getter usage from the pallet
authority-discovery. The syntax `StorageItem::<T, I>::get()` should be
used instead.

cc @muraca

---------

Co-authored-by: Liam Aharon <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
3 people authored and hitchhooker committed Jun 5, 2024
1 parent 5525dc7 commit 08b1d3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 15 additions & 0 deletions prdoc/pr_4091.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Removed `pallet::getter` usage from the authority-discovery pallet

doc:
- audience: Runtime Dev
description: |
This PR removed `pallet::getter`s from `pallet-authority-discovery`s storage items.
When accessed inside the pallet, use the syntax `StorageItem::<T, I>::get()`.
When accessed outside the pallet, use the getters current_authorities() and next_authorities() instead.

crates:
- name: pallet-authority-discovery
bump: major
2 changes: 0 additions & 2 deletions substrate/frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ pub mod pallet {
}

#[pallet::storage]
#[pallet::getter(fn keys)]
/// Keys of the current authority set.
pub(super) type Keys<T: Config> =
StorageValue<_, WeakBoundedVec<AuthorityId, T::MaxAuthorities>, ValueQuery>;

#[pallet::storage]
#[pallet::getter(fn next_keys)]
/// Keys of the next authority set.
pub(super) type NextKeys<T: Config> =
StorageValue<_, WeakBoundedVec<AuthorityId, T::MaxAuthorities>, ValueQuery>;
Expand Down

0 comments on commit 08b1d3c

Please sign in to comment.