-
Notifications
You must be signed in to change notification settings - Fork 709
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
Removed pallet::getter
usage from Polkadot Runtime pallets
#3660
Conversation
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
…nfiguration, disputes, paras_inherent}` Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
…heduler, session_info}` Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
…red` Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
@@ -1018,8 +1018,8 @@ impl<T: Config> Pallet<T> { | |||
let recipient_deposit = if system_channel { 0 } else { config.hrmp_recipient_deposit }; | |||
|
|||
if request.confirmed { | |||
if <paras::Pallet<T>>::is_valid_para(channel_id.sender) && | |||
<paras::Pallet<T>>::is_valid_para(channel_id.recipient) | |||
if paras::Pallet::<T>::is_valid_para(channel_id.sender) && |
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.
If you ever get to explore https://github.com/trailofbits/dylint for our preferred syntax, I'd be very curious to hear about it :)
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.
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.
Thanks for the ping @kianenigma. I'm fine with this change assuming this has no effect on visibility of chain state on polkadot js, is that right?
@@ -512,8 +512,7 @@ pub mod pallet { | |||
/// The active configuration for the current session. | |||
#[pallet::storage] | |||
#[pallet::whitelist_storage] | |||
#[pallet::getter(fn config)] | |||
pub(crate) type ActiveConfig<T: Config> = | |||
pub type ActiveConfig<T: Config> = |
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.
could you clarify why the change in visibility (pub(crate) -> pub) is needed and what are the implications? AFAIU, pub(crate)
provides a guarantee that external pallets won't be able to write into this storage (checked at compile time) or even read?
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.
I'm guessing previously we could specify different visibility for getters and setters and we'd lose this ability now.
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.
I think getters are always pub.
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.
Getters are always pub indeed, this change is required as it is the only way we currently have, other than writing manually all getters.
Yes, removing the getters is a 100% noop in the metadata and the external API. |
@muraca ready for last upstream sync and then we can merge. |
The CI pipeline was cancelled due to failure one of the required jobs. |
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
92e1425
tip? |
/tip medium |
@kianenigma A referendum for a medium (80 DOT) tip was successfully submitted for @muraca (12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp on polkadot). |
The referendum has appeared on Polkassembly. |
Part of #3326
@kianenigma @ggwpez
polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp