forked from TrueCloudLab/neoneo-go
35551282b0
* Initial draft of the ICO template ported from NEX. * filled in token configuration * added kyc storage prefix * fixed byte array conversion + added tests * fixed broken test + made 1 file for the token sale example. * implemented the NEP5 handlers * bumped version
22 lines
373 B
Go
22 lines
373 B
Go
package vm_test
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestStoragePutGet(t *testing.T) {
|
|
src := `
|
|
package foo
|
|
|
|
import "github.com/CityOfZion/neo-go/pkg/vm/api/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"))
|
|
}
|