forked from TrueCloudLab/frostfs-node
d252aa4a3e
Prepare all listening structures for notary events: rename(add prefix/suffix 'notification') all notification specific handlers/parsers. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
30 lines
644 B
Go
30 lines
644 B
Go
package event
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
|
)
|
|
|
|
// Handler is an Event processing function.
|
|
type Handler func(Event)
|
|
|
|
// BlockHandler is a chain block processing function.
|
|
type BlockHandler func(*block.Block)
|
|
|
|
// NotificationHandlerInfo is a structure that groups
|
|
// the parameters of the handler of particular
|
|
// contract event.
|
|
type NotificationHandlerInfo struct {
|
|
scriptHashWithType
|
|
|
|
h Handler
|
|
}
|
|
|
|
// SetHandler is an event handler setter.
|
|
func (s *NotificationHandlerInfo) SetHandler(v Handler) {
|
|
s.h = v
|
|
}
|
|
|
|
// Handler returns an event handler.
|
|
func (s NotificationHandlerInfo) Handler() Handler {
|
|
return s.h
|
|
}
|