[#14] Use notification name directly from neo-go

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-08-27 15:44:57 +03:00
parent 3d0064cb4c
commit 44b55740a8

View file

@ -161,21 +161,11 @@ func (s listener) parseAndHandle(notifyEvent *result.NotificationEvent) {
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
typEvent := TypeFromBytes(typBytes)
typEvent := TypeFromString(notifyEvent.Name)
log = log.With(
zap.Stringer("event type", typEvent),
zap.String("event type", notifyEvent.Name),
)
// get the event parser
@ -194,7 +184,7 @@ func (s listener) parseAndHandle(notifyEvent *result.NotificationEvent) {
}
// parse the notification event
event, err := parser(arr[1:])
event, err := parser(arr)
if err != nil {
log.Warn("could not parse notification event",
zap.String("error", err.Error()),