[#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,7 +4,7 @@ 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/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -26,7 +26,7 @@ func (s UpdatePeer) PublicKey() *keys.PublicKey {
|
|||
return s.publicKey
|
||||
}
|
||||
|
||||
func ParseUpdatePeer(prms []smartcontract.Parameter) (event.Event, error) {
|
||||
func ParseUpdatePeer(prms []stackitem.Item) (event.Event, error) {
|
||||
var (
|
||||
ev UpdatePeer
|
||||
err error
|
||||
|
@ -36,16 +36,8 @@ func ParseUpdatePeer(prms []smartcontract.Parameter) (event.Event, error) {
|
|||
return nil, event.WrongNumberOfParameters(2, ln)
|
||||
}
|
||||
|
||||
// parse node status
|
||||
st, err := client.IntFromStackParameter(prms[0])
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get node status")
|
||||
}
|
||||
|
||||
ev.status = uint32(st)
|
||||
|
||||
// parse public key
|
||||
key, err := client.BytesFromStackParameter(prms[1])
|
||||
key, err := client.BytesFromStackItem(prms[0])
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get public key")
|
||||
}
|
||||
|
@ -55,5 +47,13 @@ func ParseUpdatePeer(prms []smartcontract.Parameter) (event.Event, error) {
|
|||
return nil, errors.Wrap(err, "could not parse public key")
|
||||
}
|
||||
|
||||
// parse node status
|
||||
st, err := client.IntFromStackItem(prms[1])
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get node status")
|
||||
}
|
||||
|
||||
ev.status = uint32(st)
|
||||
|
||||
return ev, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue