diff --git a/prdoc/pr_4963.prdoc b/prdoc/pr_4963.prdoc new file mode 100644 index 000000000000..e274d2cbb689 --- /dev/null +++ b/prdoc/pr_4963.prdoc @@ -0,0 +1,14 @@ +# 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 pallet-proxy + +doc: + - audience: Runtime Dev + description: | + This PR removed `pallet::getter`s from `pallet-proxy`s storage items. + When accessed inside the pallet, use the syntax `StorageItem::::get()`. + +crates: + - name: pallet-proxy + bump: minor \ No newline at end of file diff --git a/substrate/frame/proxy/src/lib.rs b/substrate/frame/proxy/src/lib.rs index d681088165c8..016f2cf225e0 100644 --- a/substrate/frame/proxy/src/lib.rs +++ b/substrate/frame/proxy/src/lib.rs @@ -41,6 +41,7 @@ use frame_support::{ dispatch::GetDispatchInfo, ensure, traits::{Currency, Get, InstanceFilter, IsSubType, IsType, OriginTrait, ReservableCurrency}, + BoundedVec, }; use frame_system::{self as system, ensure_signed, pallet_prelude::BlockNumberFor}; pub use pallet::*; @@ -570,7 +571,6 @@ pub mod pallet { /// The set of account proxies. Maps the account which has delegated to the accounts /// which are being delegated to, together with the amount held on deposit. #[pallet::storage] - #[pallet::getter(fn proxies)] pub type Proxies = StorageMap< _, Twox64Concat, @@ -587,7 +587,6 @@ pub mod pallet { /// The announcements made by the proxy (key). #[pallet::storage] - #[pallet::getter(fn announcements)] pub type Announcements = StorageMap< _, Twox64Concat, @@ -601,6 +600,26 @@ pub mod pallet { } impl Pallet { + /// Public function to proxies storage. + pub fn proxies( + account: T::AccountId, + ) -> ( + BoundedVec>, T::MaxProxies>, + BalanceOf, + ) { + Proxies::::get(account) + } + + /// Public function to announcements storage. + pub fn announcements( + account: T::AccountId, + ) -> ( + BoundedVec, BlockNumberFor>, T::MaxPending>, + BalanceOf, + ) { + Announcements::::get(account) + } + /// Calculate the address of an pure account. /// /// - `who`: The spawner account.