Skip to content

Commit

Permalink
Declare Error type in decl_module! (paritytech#390)
Browse files Browse the repository at this point in the history
* Declare Error type in decl_module! for parachain-systems

* Declare Error type in decl_module! for xcm-handler
  • Loading branch information
KiChjang authored Apr 7, 2021
1 parent 1d4c02c commit cbd72e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pallets/parachain-system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions pallets/xcm-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit cbd72e7

Please sign in to comment.