cli: update default smart-contract template
This commit is contained in:
parent
ae3f15523c
commit
52275bcd9c
1 changed files with 21 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue