cli: update default smart-contract template

This commit is contained in:
Anna Shaleva 2020-08-10 16:01:56 +03:00
parent ae3f15523c
commit 52275bcd9c

View file

@ -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 {