Evgenii Stratonikov
b1614a284d
All checks were successful
Tests and linters / Run gofumpt (push) Successful in 1m26s
Tests and linters / Staticcheck (push) Successful in 3m21s
Vulncheck / Vulncheck (push) Successful in 3m36s
Build / Build Components (push) Successful in 3m58s
Tests and linters / Lint (push) Successful in 4m30s
Pre-commit hooks / Pre-commit (push) Successful in 4m35s
Tests and linters / Tests (push) Successful in 5m15s
Tests and linters / Tests with -race (push) Successful in 5m33s
Tests and linters / gopls check (push) Successful in 5m45s
Hiding them achieves nothing, as the struct has no methods and is not used concurrently. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
43 lines
960 B
Go
43 lines
960 B
Go
package event
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
)
|
|
|
|
// Handler is an Event processing function.
|
|
type Handler func(context.Context, Event)
|
|
|
|
// BlockHandler is a chain block processing function.
|
|
type BlockHandler func(context.Context, *block.Block)
|
|
|
|
// NotificationHandlerInfo is a structure that groups
|
|
// the parameters of the handler of particular
|
|
// contract event.
|
|
type NotificationHandlerInfo struct {
|
|
Contract util.Uint160
|
|
Type Type
|
|
Parser NotificationParser
|
|
Handlers []Handler
|
|
}
|
|
|
|
// NotaryHandlerInfo is a structure that groups
|
|
// the parameters of the handler of particular
|
|
// notary event.
|
|
type NotaryHandlerInfo struct {
|
|
notaryRequestTypes
|
|
|
|
h Handler
|
|
}
|
|
|
|
// SetHandler is an event handler setter.
|
|
func (nhi *NotaryHandlerInfo) SetHandler(v Handler) {
|
|
nhi.h = v
|
|
}
|
|
|
|
// Handler returns an event handler.
|
|
func (nhi NotaryHandlerInfo) Handler() Handler {
|
|
return nhi.h
|
|
}
|