native: implement Designate contract
This commit is contained in:
parent
230352d99f
commit
c468c02ef5
8 changed files with 365 additions and 117 deletions
17
pkg/core/native/util.go
Normal file
17
pkg/core/native/util.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue