From 52275bcd9c8c01630a739d23560ee34e00f8ed55 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 10 Aug 2020 16:01:56 +0300 Subject: [PATCH] cli: update default smart-contract template --- cli/smartcontract/smart_contract.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index a6f62960e..262050d91 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -61,8 +61,16 @@ const ( import "github.com/nspcc-dev/neo-go/pkg/interop/runtime" -func Main(op string, args []interface{}) { - runtime.Notify("Hello world!") +var notificationName string + +// init initializes notificationName before calling any other smart-contract method +func init() { + notificationName = "Hello world!" +} + +// RuntimeNotify sends runtime notification with "Hello world!" name +func RuntimeNotify(args []interface{}) { + runtime.Notify(notificationName, args) }` // cosignersSeparator is a special value which is used to distinguish // parameters and cosigners for invoke* commands @@ -326,6 +334,17 @@ func initSmartContract(ctx *cli.Context) error { m := ProjectConfig{ SupportedStandards: []string{}, + Events: []manifest.Event{ + { + Name: "Hello world!", + Parameters: []manifest.Parameter{ + { + Name: "args", + Type: smartcontract.ArrayType, + }, + }, + }, + }, } b, err := yaml.Marshal(m) if err != nil {