From 44b55740a84d25994ef9909556c3e1f00c250e44 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 27 Aug 2020 15:44:57 +0300 Subject: [PATCH] [#14] Use notification name directly from neo-go Signed-off-by: Alex Vanin --- pkg/morph/event/listener.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pkg/morph/event/listener.go b/pkg/morph/event/listener.go index a2fec83d3..16d72d760 100644 --- a/pkg/morph/event/listener.go +++ b/pkg/morph/event/listener.go @@ -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()),