From 6c4a2bf933236f28ed988cdc23c2c702fad1613a Mon Sep 17 00:00:00 2001 From: Alexander Popiak Date: Wed, 17 Jun 2020 13:58:40 +0200 Subject: [PATCH 1/2] Add duplicate dispatchable to trigger confusing error --- bin/node-template/pallets/template/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/node-template/pallets/template/src/lib.rs b/bin/node-template/pallets/template/src/lib.rs index 1f82857c43e47..a8fce17bb653c 100644 --- a/bin/node-template/pallets/template/src/lib.rs +++ b/bin/node-template/pallets/template/src/lib.rs @@ -72,6 +72,14 @@ decl_module! { // this is needed only if you are using events in your pallet fn deposit_event() = default; + fn on_initialize() -> Weight { + 0 + } + + fn on_initialize() -> Weight { + 0 + } + /// Just a dummy entry point. /// function that can be called by the external world as an extrinsics call /// takes a parameter of the type `AccountId`, stores it, and emits an event From 6793db27ab4151fdee736a280c63914203de8e20 Mon Sep 17 00:00:00 2001 From: Alexander Popiak Date: Wed, 17 Jun 2020 14:23:31 +0200 Subject: [PATCH 2/2] import Weight --- bin/node-template/pallets/template/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/node-template/pallets/template/src/lib.rs b/bin/node-template/pallets/template/src/lib.rs index a8fce17bb653c..5971c23acdf7d 100644 --- a/bin/node-template/pallets/template/src/lib.rs +++ b/bin/node-template/pallets/template/src/lib.rs @@ -10,6 +10,7 @@ /// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs use frame_support::{decl_module, decl_storage, decl_event, decl_error, dispatch}; +use frame_support::weights::Weight; use frame_system::{self as system, ensure_signed}; #[cfg(test)]