d62a367900
It gives access to the internal value's Value() which is essential for interop functions that need to get something from InteropItems. And it also simplifies some already existing code along the way.
22 lines
550 B
Go
22 lines
550 B
Go
package vm
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// InteropFunc allows to hook into the VM.
|
|
type InteropFunc func(vm *VM) error
|
|
|
|
// runtimeLog will handle the syscall "Neo.Runtime.Log" for printing and logging stuff.
|
|
func runtimeLog(vm *VM) error {
|
|
item := vm.Estack().Pop()
|
|
fmt.Printf("NEO-GO-VM (log) > %s\n", item.Value())
|
|
return nil
|
|
}
|
|
|
|
// runtimeNotify will handle the syscall "Neo.Runtime.Notify" for printing and logging stuff.
|
|
func runtimeNotify(vm *VM) error {
|
|
item := vm.Estack().Pop()
|
|
fmt.Printf("NEO-GO-VM (notify) > %s\n", item.Value())
|
|
return nil
|
|
}
|