neo-go/cli/testdata/invalid2/invalid.go
Evgenii Stratonikov 75a9a42403 compiler: check emitted event names
Check that all `Notify` invocations in source correspond to some event
in manifest.
Helpful for typos such as `transfer` instead of `Transfer`.
2020-11-26 13:49:58 +03:00

21 lines
481 B
Go

// invalid is an example of contract which doesn't pass event check.
package invalid2
import (
"github.com/nspcc-dev/neo-go/pkg/interop"
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
)
// Notify1 emits correctly typed event.
func Notify1() bool {
runtime.Notify("Event", interop.Hash160{1, 2, 3})
return true
}
// Notify2 emits invalid event (extra parameter).
func Notify2() bool {
runtime.Notify("Event", interop.Hash160{1, 2, 3}, "extra parameter")
return true
}