[#324] morph/listener: Register handlers of new chain blocks
Extend Listener with RegisterBlockHandler method. All block handlers are called on each block read from Subscriber.BlockNotifications channel. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
c65d1d9db9
commit
23c220ae28
3 changed files with 63 additions and 9 deletions
|
@ -1,8 +1,15 @@
|
|||
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)
|
||||
|
||||
// HandlerInfo is a structure that groups
|
||||
// the parameters of the handler of particular
|
||||
// contract event.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue