vm: move InteropNameToID to emit package

This commit is contained in:
Evgenii Stratonikov 2020-04-15 17:13:50 +03:00
parent 93d2a3e031
commit bfbbef952a
9 changed files with 40 additions and 34 deletions

View file

@ -19,7 +19,7 @@ import (
)
func fooInteropGetter(id uint32) *InteropFuncPrice {
if id == InteropNameToID([]byte("foo")) {
if id == emit.InteropNameToID([]byte("foo")) {
return &InteropFuncPrice{func(evm *VM) error {
evm.Estack().PushVal(1)
return nil
@ -46,7 +46,7 @@ func TestInteropHookViaID(t *testing.T) {
v.RegisterInteropGetter(fooInteropGetter)
buf := io.NewBufBinWriter()
fooid := InteropNameToID([]byte("foo"))
fooid := emit.InteropNameToID([]byte("foo"))
var id = make([]byte, 4)
binary.LittleEndian.PutUint32(id, fooid)
emit.Syscall(buf.BinWriter, string(id))