Declare Error type in decl_module! (#390)

* Declare Error type in decl_module! for parachain-systems

* Declare Error type in decl_module! for xcm-handler
This commit is contained in:
Keith Yeung
2021-04-07 02:38:41 -07:00
committed by GitHub
parent c995f6c76e
commit db7fdce9b1
2 changed files with 4 additions and 0 deletions
@@ -140,6 +140,8 @@ decl_storage! {
// The pallet's dispatchable functions. // The pallet's dispatchable functions.
decl_module! { decl_module! {
pub struct Module<T: Config> for enum Call where origin: T::Origin { pub struct Module<T: Config> for enum Call where origin: T::Origin {
type Error = Error<T>;
// Initializing events // Initializing events
// this is needed only if you are using events in your pallet // this is needed only if you are using events in your pallet
fn deposit_event() = default; fn deposit_event() = default;
+2
View File
@@ -79,6 +79,8 @@ decl_error! {
decl_module! { decl_module! {
pub struct Module<T: Config> for enum Call where origin: T::Origin { pub struct Module<T: Config> for enum Call where origin: T::Origin {
type Error = Error<T>;
fn deposit_event() = default; fn deposit_event() = default;
#[weight = 1_000] #[weight = 1_000]