mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-12 01:10:36 +00:00
f8979fe7af
* golint and minor changes to make code readable
20 lines
599 B
Go
20 lines
599 B
Go
package pubsub
|
|
|
|
// EventType is an enum
|
|
// representing the types of messages we can subscribe to
|
|
type EventType int
|
|
|
|
const (
|
|
// NewBlock is called When blockchain connects a new block, it will emit an NewBlock Event
|
|
NewBlock EventType = iota
|
|
// BadBlock is called When blockchain declines a block, it will emit a new block event
|
|
BadBlock
|
|
// BadHeader is called When blockchain rejects a Header, it will emit this event
|
|
BadHeader
|
|
)
|
|
|
|
// Event represents a new Event that a subscriber can listen to
|
|
type Event struct {
|
|
Type EventType // E.g. event.NewBlock
|
|
data []byte // Raw information
|
|
}
|