[#971] morph/event: Change notification parser's signature

Parsers should have original notification
structure to be able to construct internal
event structure that contains necessary
for unique nonce calculation information.
So notification parsers take raw notification
structure instead of slice of stack items.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-10-22 13:06:08 +03:00 committed by Alex Vanin
parent 3666ae7ad2
commit c167ae26f9
35 changed files with 365 additions and 203 deletions

View file

@ -4,12 +4,12 @@ import (
"fmt"
"github.com/nspcc-dev/neo-go/pkg/network/payload"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
)
// NotificationParser is a function that constructs Event
// from the StackItem list.
type NotificationParser func([]stackitem.Item) (Event, error)
type NotificationParser func(*subscriptions.NotificationEvent) (Event, error)
// NotificationParserInfo is a structure that groups
// the parameters of particular contract