gadgets

package
v0.22.8-patch-3-fix-co... Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: AGPL-3.0 Imports: 4 Imported by: 3 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heights

type Heights struct {
	events.Noop
	// contains filtered or unexported fields
}

Heights is a protocol events consumer that provides an interface to subscribe to callbacks when chain state reaches a particular height.

func NewHeights

func NewHeights() *Heights

NewHeights returns a new Heights events gadget.

func (*Heights) BlockFinalized

func (g *Heights) BlockFinalized(block *flow.Header)

BlockFinalized handles block finalized protocol events, triggering height callbacks as needed.

func (*Heights) OnHeight

func (g *Heights) OnHeight(height uint64, callback func())

OnHeight registers the callback for the given height.

type IdentityDeltas added in v0.12.0

type IdentityDeltas struct {
	events.Noop
	// contains filtered or unexported fields
}

IdentityDeltas is a protocol events consumer that provides an interface to subscribe to callbacks any time an identity table change (or possible change) is finalized.

TODO add slashing/ejection events here once implemented

func NewIdentityDeltas added in v0.12.0

func NewIdentityDeltas(cb func()) *IdentityDeltas

NewIdentityDeltas returns a new IdentityDeltas events gadget.

func (*IdentityDeltas) EpochCommittedPhaseStarted added in v0.12.0

func (g *IdentityDeltas) EpochCommittedPhaseStarted(_ uint64, _ *flow.Header)

func (*IdentityDeltas) EpochSetupPhaseStarted added in v0.12.0

func (g *IdentityDeltas) EpochSetupPhaseStarted(_ uint64, _ *flow.Header)

func (*IdentityDeltas) EpochTransition added in v0.12.0

func (g *IdentityDeltas) EpochTransition(_ uint64, _ *flow.Header)

type Views added in v0.20.0

type Views struct {
	sync.Mutex
	events.Noop
	// contains filtered or unexported fields
}

Views is a protocol events consumer that provides an interface to subscribe to callbacks when consensus reaches a particular view. When a callback is registered for a view, it will be invoked when the first block with block.View >= V is finalized. Callbacks for earlier views are executed before callbacks for later views, and callbacks for the same view are executed on a FIFO basis.

func NewViews added in v0.20.0

func NewViews() *Views

NewViews returns a new Views events gadget.

func (*Views) BlockFinalized added in v0.20.0

func (v *Views) BlockFinalized(block *flow.Header)

BlockFinalized handles block finalized protocol events, triggering view callbacks as needed.

func (*Views) OnView added in v0.20.0

func (v *Views) OnView(view uint64, callback events.OnViewCallback)

OnView registers the callback for the given view.

Jump to

Keyboard shortcuts

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