From db7fdce9b1a8bc6b803a31de3e3618a8c335bc08 Mon Sep 17 00:00:00 2001
From: Keith Yeung <kungfukeith11@gmail.com>
Date: Wed, 7 Apr 2021 02:38:41 -0700
Subject: [PATCH] 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
---
 cumulus/pallets/parachain-system/src/lib.rs | 2 ++
 cumulus/pallets/xcm-handler/src/lib.rs      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs
index 3b575803604..cb61d53ddb3 100644
--- a/cumulus/pallets/parachain-system/src/lib.rs
+++ b/cumulus/pallets/parachain-system/src/lib.rs
@@ -140,6 +140,8 @@ decl_storage! {
 // The pallet's dispatchable functions.
 decl_module! {
 	pub struct Module<T: Config> for enum Call where origin: T::Origin {
+		type Error = Error<T>;
+
 		// Initializing events
 		// this is needed only if you are using events in your pallet
 		fn deposit_event() = default;
diff --git a/cumulus/pallets/xcm-handler/src/lib.rs b/cumulus/pallets/xcm-handler/src/lib.rs
index a7d70ea3969..ed9b2a3d528 100644
--- a/cumulus/pallets/xcm-handler/src/lib.rs
+++ b/cumulus/pallets/xcm-handler/src/lib.rs
@@ -79,6 +79,8 @@ decl_error! {
 
 decl_module! {
 	pub struct Module<T: Config> for enum Call where origin: T::Origin {
+		type Error = Error<T>;
+
 		fn deposit_event() = default;
 
 		#[weight = 1_000]
-- 
GitLab