diff --git a/prdoc/pr_4417.prdoc b/prdoc/pr_4417.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..5aa72edd066a7de2a8e66ca1464446c503802644 --- /dev/null +++ b/prdoc/pr_4417.prdoc @@ -0,0 +1,13 @@ +# 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 pallet-contracts-mock-network + +doc: + - audience: Runtime Dev + description: | + This PR removed the `pallet::getter`s from `pallet-contracts-mock-network`s storage items. + +crates: + - name: pallet-contracts-mock-network + bump: minor diff --git a/substrate/frame/contracts/mock-network/src/mocks/msg_queue.rs b/substrate/frame/contracts/mock-network/src/mocks/msg_queue.rs index cc81b6bd636e54187e3ba09500fc39b472ed1943..bfdf6dd97eaf17fc0601f78c7c179e411c3a143d 100644 --- a/substrate/frame/contracts/mock-network/src/mocks/msg_queue.rs +++ b/substrate/frame/contracts/mock-network/src/mocks/msg_queue.rs @@ -47,17 +47,15 @@ pub mod pallet { pub struct Pallet<T>(_); #[pallet::storage] - #[pallet::getter(fn parachain_id)] pub(super) type ParachainId<T: Config> = StorageValue<_, ParaId, ValueQuery>; #[pallet::storage] - #[pallet::getter(fn received_dmp)] /// A queue of received DMP messages pub(super) type ReceivedDmp<T: Config> = StorageValue<_, Vec<Xcm<T::RuntimeCall>>, ValueQuery>; impl<T: Config> Get<ParaId> for Pallet<T> { fn get() -> ParaId { - Self::parachain_id() + ParachainId::<T>::get() } } @@ -89,6 +87,14 @@ pub mod pallet { ParachainId::<T>::put(para_id); } + pub fn parachain_id() -> ParaId { + ParachainId::<T>::get() + } + + pub fn received_dmp() -> Vec<Xcm<T::RuntimeCall>> { + ReceivedDmp::<T>::get() + } + fn handle_xcmp_message( sender: ParaId, _sent_at: RelayBlockNumber, @@ -169,7 +175,7 @@ pub mod pallet { limit, Weight::zero(), ); - <ReceivedDmp<T>>::append(x); + ReceivedDmp::<T>::append(x); Self::deposit_event(Event::ExecutedDownward(id, outcome)); }, },