-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow pallet to declare its default parts and make construct_runtime automatically use them by default #8084
Comments
Are there any cases where a pallet part is included in a pallet, but the user doesn't want to declare it to be used? If not, then we could automatically declare the existence of a pallet part simply via the inclusion of its corresponding attribute, i.e. this pallet: #[frame_support::pallet]
pub mod pallet {
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
} would automatically declare Then if a user tries to use a non-existent pallet part during runtime construction, we could then generate a more helpful error message saying something like |
indeed I think
I also agree and on that, but that would be not possible to support in old decl_* macros, so as long as it is not deprecated I'm not sure how it can be implemented. But in general yes I think pallet macro declares pallet items, those items are to be aggregated in construct_runtime. Also I don't think we need to support declaration of parts for decl_* macros. no need to enhance decl_* macros, but we shouldn't break them IMHO |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
still relevant |
Instead of having to declare:
we could be able to do:
(syntax must be improved)
a stale PR exist #6494 but doesn't implement the
except_part
logic.The text was updated successfully, but these errors were encountered: