neo-go/examples/engine/engine.go

30 lines
892 B
Go
Raw Permalink Normal View History

package enginecontract
import (
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
)
2020-08-10 10:42:02 +00:00
// NotifyScriptContainer sends runtime notification with script container hash
func NotifyScriptContainer() {
tx := runtime.GetScriptContainer()
runtime.Notify("Tx", tx.Hash)
2020-08-10 10:42:02 +00:00
}
2020-08-10 10:42:02 +00:00
// NotifyCallingScriptHash sends runtime notification with calling script hash
func NotifyCallingScriptHash() {
callingScriptHash := runtime.GetCallingScriptHash()
runtime.Notify("Calling", callingScriptHash)
2020-08-10 10:42:02 +00:00
}
2020-08-10 10:42:02 +00:00
// NotifyExecutingScriptHash sends runtime notification about executing script hash
func NotifyExecutingScriptHash() {
execScriptHash := runtime.GetExecutingScriptHash()
runtime.Notify("Executing", execScriptHash)
2020-08-10 10:42:02 +00:00
}
2020-08-10 10:42:02 +00:00
// NotifyEntryScriptHash sends notification about entry script hash
func NotifyEntryScriptHash() {
entryScriptHash := runtime.GetEntryScriptHash()
runtime.Notify("Entry", entryScriptHash)
}