2018-03-30 16:15:06 +00:00
|
|
|
package vm
|
|
|
|
|
2018-04-10 09:45:31 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
2018-03-30 16:15:06 +00:00
|
|
|
|
|
|
|
// InteropFunc allows to hook into the VM.
|
|
|
|
type InteropFunc func(vm *VM) error
|
|
|
|
|
2019-10-22 14:56:03 +00:00
|
|
|
// runtimeLog handles the syscall "Neo.Runtime.Log" for printing and logging stuff.
|
2018-04-10 09:45:31 +00:00
|
|
|
func runtimeLog(vm *VM) error {
|
|
|
|
item := vm.Estack().Pop()
|
2019-10-03 13:12:24 +00:00
|
|
|
fmt.Printf("NEO-GO-VM (log) > %s\n", item.Value())
|
2018-04-10 09:45:31 +00:00
|
|
|
return nil
|
2018-03-30 16:15:06 +00:00
|
|
|
}
|
|
|
|
|
2019-10-22 14:56:03 +00:00
|
|
|
// runtimeNotify handles the syscall "Neo.Runtime.Notify" for printing and logging stuff.
|
2018-04-10 09:45:31 +00:00
|
|
|
func runtimeNotify(vm *VM) error {
|
|
|
|
item := vm.Estack().Pop()
|
2019-10-03 13:12:24 +00:00
|
|
|
fmt.Printf("NEO-GO-VM (notify) > %s\n", item.Value())
|
2018-04-10 09:45:31 +00:00
|
|
|
return nil
|
2018-03-30 16:15:06 +00:00
|
|
|
}
|