frostfs-node/pkg/morph/event/neofs/unbind.go
Pavel Karpy c167ae26f9 [#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>
2021-11-19 09:58:03 +03:00

31 lines
546 B
Go

package neofs
import (
"fmt"
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
)
type Unbind struct {
bindCommon
}
func ParseUnbind(e *subscriptions.NotificationEvent) (event.Event, error) {
var (
ev Unbind
err error
)
params, err := event.ParseStackArray(e)
if err != nil {
return nil, fmt.Errorf("could not parse stack items from notify event: %w", err)
}
err = parseBind(&ev.bindCommon, params)
if err != nil {
return nil, err
}
return ev, nil
}