forked from TrueCloudLab/frostfs-node
[#14] Use notification name directly from neo-go
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
3d0064cb4c
commit
44b55740a8
1 changed files with 3 additions and 13 deletions
|
@ -161,21 +161,11 @@ func (s listener) parseAndHandle(notifyEvent *result.NotificationEvent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// first item must be a byte array
|
|
||||||
typBytes, err := client.BytesFromStackParameter(arr[0])
|
|
||||||
if err != nil {
|
|
||||||
log.Warn("first array item is not a byte array",
|
|
||||||
zap.String("error", err.Error()),
|
|
||||||
)
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate event type from bytes
|
// calculate event type from bytes
|
||||||
typEvent := TypeFromBytes(typBytes)
|
typEvent := TypeFromString(notifyEvent.Name)
|
||||||
|
|
||||||
log = log.With(
|
log = log.With(
|
||||||
zap.Stringer("event type", typEvent),
|
zap.String("event type", notifyEvent.Name),
|
||||||
)
|
)
|
||||||
|
|
||||||
// get the event parser
|
// get the event parser
|
||||||
|
@ -194,7 +184,7 @@ func (s listener) parseAndHandle(notifyEvent *result.NotificationEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse the notification event
|
// parse the notification event
|
||||||
event, err := parser(arr[1:])
|
event, err := parser(arr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("could not parse notification event",
|
log.Warn("could not parse notification event",
|
||||||
zap.String("error", err.Error()),
|
zap.String("error", err.Error()),
|
||||||
|
|
Loading…
Reference in a new issue