neoneo-go/pkg/core/native/util.go
Anna Shaleva c013522296 core: remove native contracts' name method
We have `name` in contract manifest.
2020-11-25 18:37:29 +03:00

17 lines
410 B
Go

package native
import (
"github.com/nspcc-dev/neo-go/pkg/core/dao"
"github.com/nspcc-dev/neo-go/pkg/core/storage"
"github.com/nspcc-dev/neo-go/pkg/io"
)
func getSerializableFromDAO(id int32, d dao.DAO, key []byte, item io.Serializable) error {
si := d.GetStorageItem(id, key)
if si == nil {
return storage.ErrKeyNotFound
}
r := io.NewBinReaderFromBuf(si.Value)
item.DecodeBinary(r)
return r.Err
}