events

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ForkDetected    = &FeedOf[struct{}]{}     // Found a block that indicates fork.
	NewChainHead    = &FeedOf[*types.Block]{} // Chain switched to a new head block.
	NewMinedBlock   = &FeedOf[*types.Block]{} // A new block is mined into current chain
	NewNetworkBlock = &FeedOf[BlockWithTd]{}  // A new block recieved from network
	NewNetworkTx    = &FeedOf[types.Tx]{}
	NewTx           = &FeedOf[types.Tx]{}
	SyncStarted     = &FeedOf[struct{}]{}
	SyncFinished    = &FeedOf[struct{}]{}
)

Functions

This section is empty.

Types

type BlockWithTd added in v0.0.3

type BlockWithTd struct {
	*types.Block
	Td *big.Int
}

type Callback

type Callback[T any] func(data T)

type FeedOf

type FeedOf[T any] struct {
	// contains filtered or unexported fields
}

Wrapper of go-ethereum/event.FeedOf that provides easier Subscribe and Unsubscribe calls

func (*FeedOf[T]) Send

func (e *FeedOf[T]) Send(data T) (sent int)

func (*FeedOf[T]) Subscribe

func (e *FeedOf[T]) Subscribe(id string, callback Callback[T])

func (*FeedOf[T]) Unsubscribe

func (e *FeedOf[T]) Unsubscribe(id string) *sync.WaitGroup

type Subscription

type Subscription[T any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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