forked from TrueCloudLab/frostfs-contract
97a5e27403
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
21 lines
528 B
Go
21 lines
528 B
Go
package common
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
|
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
|
|
)
|
|
|
|
func GetList(ctx storage.Context, key interface{}) [][]byte {
|
|
data := storage.Get(ctx, key)
|
|
if data != nil {
|
|
return std.Deserialize(data.([]byte)).([][]byte)
|
|
}
|
|
|
|
return [][]byte{}
|
|
}
|
|
|
|
// SetSerialized serializes data and puts it into contract storage.
|
|
func SetSerialized(ctx storage.Context, key interface{}, value interface{}) {
|
|
data := std.Serialize(value)
|
|
storage.Put(ctx, key, data)
|
|
}
|