Add helloevent
Signed-off-by: Stanislav Bogatyrev <s.bogatyrev@yadro.com>
This commit is contained in:
parent
230921d7ee
commit
9ce38e6ffa
4 changed files with 32 additions and 0 deletions
5
l3/helloevent/go.mod
Normal file
5
l3/helloevent/go.mod
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module helloevent
|
||||||
|
|
||||||
|
go 1.20
|
||||||
|
|
||||||
|
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231108063405-7045d3bd63d9
|
2
l3/helloevent/go.sum
Normal file
2
l3/helloevent/go.sum
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231108063405-7045d3bd63d9 h1:VcjYKiGIn4EuUfibi4QI6lWkAFfg7PTYL8TxMvd+7Ck=
|
||||||
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231108063405-7045d3bd63d9/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
15
l3/helloevent/helloevent.go
Normal file
15
l3/helloevent/helloevent.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package helloevent
|
||||||
|
|
||||||
|
import "github.com/nspcc-dev/neo-go/pkg/interop/runtime"
|
||||||
|
|
||||||
|
var notificationName string
|
||||||
|
|
||||||
|
// init initializes notificationName before calling any other smart-contract method
|
||||||
|
func init() {
|
||||||
|
notificationName = "HelloWorld"
|
||||||
|
}
|
||||||
|
|
||||||
|
// RuntimeNotify sends runtime notification with "HelloWorld" name
|
||||||
|
func RuntimeNotify(args []any) {
|
||||||
|
runtime.Notify(notificationName, args)
|
||||||
|
}
|
10
l3/helloevent/helloevent.yml
Normal file
10
l3/helloevent/helloevent.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
name: "helloevent"
|
||||||
|
sourceurl: https://git.frostfs.info/Web3N3/web3-course
|
||||||
|
supportedstandards: []
|
||||||
|
events:
|
||||||
|
- name: HelloWorld
|
||||||
|
parameters:
|
||||||
|
- name: args
|
||||||
|
type: Array
|
||||||
|
permissions:
|
||||||
|
- methods: '*'
|
Loading…
Reference in a new issue