mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-30 09:33:36 +00:00
a1e3655560
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.
22 lines
374 B
Go
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"))
|
|
}
|