[#74] Fix order of netmap.UpdateState event arguments
This event has node status first and public key second. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
cd34145969
commit
f40f1ca0c0
1 changed files with 9 additions and 9 deletions
|
@ -36,8 +36,16 @@ func ParseUpdatePeer(prms []smartcontract.Parameter) (event.Event, error) {
|
||||||
return nil, event.WrongNumberOfParameters(2, ln)
|
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
|
// parse public key
|
||||||
key, err := client.BytesFromStackParameter(prms[0])
|
key, err := client.BytesFromStackParameter(prms[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "could not get public key")
|
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")
|
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
|
return ev, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue