neo-go/pkg/vm/tests/syscall_test.go
Roman Khimov a1e3655560 interop: move into pkg/interop, replace pkg/vm/api
neo-storm has developed more wrappers for syscall APIs, so they can and should
be used as a drop-in replacement for pkg/vm/api. Moving it out of vm, as it's
not exactly related to the VM itself.
2019-08-15 19:41:51 +03:00

22 lines
374 B
Go

package vm_test
import (
"testing"
)
func TestStoragePutGet(t *testing.T) {
src := `
package foo
import "github.com/CityOfZion/neo-go/pkg/interop/storage"
func Main() string {
ctx := storage.GetContext()
key := []byte("token")
storage.Put(ctx, key, []byte("foo"))
x := storage.Get(ctx, key)
return x.(string)
}
`
eval(t, src, []byte("foo"))
}