types

package
v0.0.0-...-c7fad54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventDataTypeNewBlock       = byte(0x01)
	EventDataTypeFork           = byte(0x02)
	EventDataTypeTx             = byte(0x03)
	EventDataTypeNewBlockHeader = byte(0x04)

	EventDataTypeRoundState = byte(0x11)
	EventDataTypeVote       = byte(0x12)
)

Variables

View Source
var (
	EventDataNameNewBlock       = "new_block"
	EventDataNameNewBlockHeader = "new_block_header"
	EventDataNameTx             = "tx"
	EventDataNameRoundState     = "round_state"
	EventDataNameVote           = "vote"
)

Functions

func AddListenerForEvent

func AddListenerForEvent(evsw EventSwitch, id, event string, cb func(data TMEventData))

func EventStringBond

func EventStringBond() string

Reserved

func EventStringCompleteProposal

func EventStringCompleteProposal() string

func EventStringDupeout

func EventStringDupeout() string

func EventStringFork

func EventStringFork() string

func EventStringLock

func EventStringLock() string

func EventStringNewBlock

func EventStringNewBlock() string

func EventStringNewBlockHeader

func EventStringNewBlockHeader() string

func EventStringNewRound

func EventStringNewRound() string

func EventStringNewRoundStep

func EventStringNewRoundStep() string

func EventStringPolka

func EventStringPolka() string

func EventStringRebond

func EventStringRebond() string

func EventStringRelock

func EventStringRelock() string

func EventStringTimeoutPropose

func EventStringTimeoutPropose() string

func EventStringTimeoutWait

func EventStringTimeoutWait() string

func EventStringUnbond

func EventStringUnbond() string

func EventStringUnlock

func EventStringUnlock() string

func EventStringVote

func EventStringVote() string

func FireEventCompleteProposal

func FireEventCompleteProposal(fireable events.Fireable, rs EventDataRoundState)

func FireEventLock

func FireEventLock(fireable events.Fireable, rs EventDataRoundState)

func FireEventNewBlock

func FireEventNewBlock(fireable events.Fireable, block EventDataNewBlock)

func FireEventNewBlockHeader

func FireEventNewBlockHeader(fireable events.Fireable, header EventDataNewBlockHeader)

func FireEventNewRound

func FireEventNewRound(fireable events.Fireable, rs EventDataRoundState)

func FireEventNewRoundStep

func FireEventNewRoundStep(fireable events.Fireable, rs EventDataRoundState)

func FireEventPolka

func FireEventPolka(fireable events.Fireable, rs EventDataRoundState)

func FireEventRelock

func FireEventRelock(fireable events.Fireable, rs EventDataRoundState)

func FireEventTimeoutPropose

func FireEventTimeoutPropose(fireable events.Fireable, rs EventDataRoundState)

func FireEventTimeoutWait

func FireEventTimeoutWait(fireable events.Fireable, rs EventDataRoundState)

func FireEventUnlock

func FireEventUnlock(fireable events.Fireable, rs EventDataRoundState)

func FireEventVote

func FireEventVote(fireable events.Fireable, vote EventDataVote)

Types

type EventCache

type EventCache interface {
	Fireable
	Flush()
}

func NewEventCache

func NewEventCache(evsw EventSwitch) EventCache

type EventDataNewBlock

type EventDataNewBlock struct {
}

func (EventDataNewBlock) AssertIsTMEventData

func (_ EventDataNewBlock) AssertIsTMEventData()

type EventDataNewBlockHeader

type EventDataNewBlockHeader struct {
}

light weight event for benchmarking

func (EventDataNewBlockHeader) AssertIsTMEventData

func (_ EventDataNewBlockHeader) AssertIsTMEventData()

type EventDataRoundState

type EventDataRoundState struct {
	Height int    `json:"height"`
	Round  int    `json:"round"`
	Step   string `json:"step"`

	// private, not exposed to websockets
	RoundState interface{} `json:"-"`
}

NOTE: This goes into the replay WAL

func (EventDataRoundState) AssertIsTMEventData

func (_ EventDataRoundState) AssertIsTMEventData()

type EventDataTx

type EventDataTx struct {
	Height int `json:"height"`
	//Tx     Tx            `json:"tx"`
	Data  data.Bytes    `json:"data"`
	Log   string        `json:"log"`
	Code  abci.CodeType `json:"code"`
	Error string        `json:"error"` // this is redundant information for now
}

All txs fire EventDataTx

func (EventDataTx) AssertIsTMEventData

func (_ EventDataTx) AssertIsTMEventData()

type EventDataVote

type EventDataVote struct {
}

func (EventDataVote) AssertIsTMEventData

func (_ EventDataVote) AssertIsTMEventData()

type EventSwitch

type EventSwitch interface {
	events.EventSwitch
}

func NewEventSwitch

func NewEventSwitch() EventSwitch

type Eventable

type Eventable interface {
	SetEventSwitch(EventSwitch)
}

type Fireable

type Fireable interface {
	events.Fireable
}

type TMEventData

type TMEventData struct {
	TMEventDataInner `json:"unwrap"`
}

func (TMEventData) Empty

func (tmr TMEventData) Empty() bool

func (TMEventData) MarshalJSON

func (tmr TMEventData) MarshalJSON() ([]byte, error)

func (*TMEventData) UnmarshalJSON

func (tmr *TMEventData) UnmarshalJSON(data []byte) (err error)

func (TMEventData) Unwrap

func (tmr TMEventData) Unwrap() TMEventDataInner

type TMEventDataInner

type TMEventDataInner interface {
	events.EventData
}

implements events.EventData

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL