diff --git a/pkg/morph/event/netmap/update_peer.go b/pkg/morph/event/netmap/update_peer.go index 259cd364..20bd0324 100644 --- a/pkg/morph/event/netmap/update_peer.go +++ b/pkg/morph/event/netmap/update_peer.go @@ -36,8 +36,16 @@ 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[0]) + key, err := client.BytesFromStackParameter(prms[1]) if err != nil { return nil, errors.Wrap(err, "could not get public key") } @@ -47,13 +55,5 @@ func ParseUpdatePeer(prms []smartcontract.Parameter) (event.Event, error) { return nil, errors.Wrap(err, "could not parse public key") } - // parse node status - st, err := client.IntFromStackParameter(prms[1]) - if err != nil { - return nil, errors.Wrap(err, "could not get node status") - } - - ev.status = uint32(st) - return ev, nil }