Make hooks and call attributes optional in pallet macro (#8853)

* Make #[pallet::hooks] optional

* Make #[pallet::call] optional

* Remove unused imports

* Update UI test expectations

* Update UI test expectations

* Remove unnecessary HooksDef::empty method

* Remove unnecessary CallDef::empty method

* Clarify what would happen when no call or hooks are specified in a pallet
This commit is contained in:
Keith Yeung
2021-05-20 12:31:56 -07:00
committed by GitHub
parent 029b8a1d07
commit e5954cf863
9 changed files with 90 additions and 57 deletions
@@ -406,20 +406,11 @@ pub mod pallet2 {
/// Test that the supertrait check works when we pass some parameter to the `frame_system::Config`.
#[frame_support::pallet]
pub mod pallet3 {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config<Origin = ()> {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
}
frame_support::parameter_types!(