frostfs-node/pkg/morph/event/frostfs/unbind.go
Dmitrii Stepanov 31b4da225a [#280] ir: Add frostfs processor unit tests
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-05-02 08:48:07 +00:00

33 lines
568 B
Go

package frostfs
import (
"fmt"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
"github.com/nspcc-dev/neo-go/pkg/core/state"
)
type Unbind struct {
BindCommon
}
func ParseUnbind(e *state.ContainedNotificationEvent) (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
}
ev.TxHashValue = e.Container
return ev, nil
}