forked from TrueCloudLab/frostfs-node
[#124] Update neo-go to pre-preview4 version
Neo-go does not use smartcontract.Parameter to return values anymore, so it's convertes partly removed from neofs-node. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
2bd827a478
commit
174efc9df3
35 changed files with 309 additions and 841 deletions
|
@ -4,8 +4,8 @@ import (
|
|||
"crypto/elliptic"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -23,7 +23,7 @@ func (b Bind) Keys() []*keys.PublicKey { return b.keys }
|
|||
|
||||
func (b Bind) User() util.Uint160 { return b.user }
|
||||
|
||||
func ParseBind(params []smartcontract.Parameter) (event.Event, error) {
|
||||
func ParseBind(params []stackitem.Item) (event.Event, error) {
|
||||
var (
|
||||
ev Bind
|
||||
err error
|
||||
|
@ -34,7 +34,7 @@ func ParseBind(params []smartcontract.Parameter) (event.Event, error) {
|
|||
}
|
||||
|
||||
// parse user
|
||||
user, err := client.BytesFromStackParameter(params[0])
|
||||
user, err := client.BytesFromStackItem(params[0])
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get bind user")
|
||||
}
|
||||
|
@ -45,14 +45,14 @@ func ParseBind(params []smartcontract.Parameter) (event.Event, error) {
|
|||
}
|
||||
|
||||
// parse keys
|
||||
bindKeys, err := client.ArrayFromStackParameter(params[1])
|
||||
bindKeys, err := client.ArrayFromStackItem(params[1])
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get bind keys")
|
||||
}
|
||||
|
||||
ev.keys = make([]*keys.PublicKey, 0, len(bindKeys))
|
||||
for i := range bindKeys {
|
||||
rawKey, err := client.BytesFromStackParameter(bindKeys[i])
|
||||
rawKey, err := client.BytesFromStackItem(bindKeys[i])
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get bind public key")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue