neo-go/pkg/compiler/syscall_test.go
2020-03-03 17:21:42 +03:00

22 lines
379 B
Go

package compiler_test
import (
"testing"
)
func TestStoragePutGet(t *testing.T) {
src := `
package foo
import "github.com/nspcc-dev/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"))
}