Documentation ¶
Index ¶
- func NewBlockTimeFetcher(log *logging.Logger, client Client) *blockTimeFetcher
- type Assets
- type Client
- type Config
- type Engine
- type Filterer
- type Forwarder
- type LogFilterer
- func (f *LogFilterer) CurrentHeight(ctx context.Context) uint64
- func (f *LogFilterer) FilterCollateralEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
- func (f *LogFilterer) FilterMultisigControlEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
- func (f *LogFilterer) FilterStakingEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
- func (f *LogFilterer) FilterVestingEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
- type OnEventFound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBlockTimeFetcher ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine( log *logging.Logger, filterer Filterer, forwarder Forwarder, stakingDeployment types.EthereumContract, vestingDeployment types.EthereumContract, multiSigDeployment types.EthereumContract, ) *Engine
func (*Engine) ReloadConf ¶
func (*Engine) Start ¶
func (e *Engine) Start()
Start starts the polling of the Ethereum bridges, listens to the events they emit and forward it to the network.
func (*Engine) Stop ¶
func (e *Engine) Stop()
Stop stops the engine, its polling and event forwarding.
func (*Engine) UpdateMultiSigControlStartingBlock ¶
func (*Engine) UpdateStakingStartingBlock ¶
type Filterer ¶
type Filterer interface { FilterCollateralEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound) FilterStakingEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound) FilterVestingEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound) FilterMultisigControlEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound) CurrentHeight(context.Context) uint64 }
type Forwarder ¶
type Forwarder interface {
ForwardFromSelf(*commandspb.ChainEvent)
}
type LogFilterer ¶
type LogFilterer struct {
// contains filtered or unexported fields
}
LogFilterer wraps the Ethereum event filterers to return Vega events.
func NewLogFilterer ¶
func NewLogFilterer( log *logging.Logger, ethClient Client, collateralBridge types.EthereumContract, stakingBridge types.EthereumContract, vestingBridge types.EthereumContract, multiSigControl types.EthereumContract, assets Assets, ) (*LogFilterer, error)
func (*LogFilterer) CurrentHeight ¶
func (f *LogFilterer) CurrentHeight(ctx context.Context) uint64
func (*LogFilterer) FilterCollateralEvents ¶
func (f *LogFilterer) FilterCollateralEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
FilterCollateralEvents retrieves the events from the collateral bridge on Ethereum starting at startAt, transform them into ChainEvent, and pass it to the OnEventFound callback. The properties startAt and stopAt are inclusive.
func (*LogFilterer) FilterMultisigControlEvents ¶
func (f *LogFilterer) FilterMultisigControlEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
func (*LogFilterer) FilterStakingEvents ¶
func (f *LogFilterer) FilterStakingEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
FilterStakingEvents retrieves the events from the staking bridge on Ethereum starting at startAt, transform them into ChainEvent, and pass it to the OnEventFound callback. The properties startAt and stopAt are inclusive.
func (*LogFilterer) FilterVestingEvents ¶
func (f *LogFilterer) FilterVestingEvents(ctx context.Context, startAt, stopAt uint64, cb OnEventFound)
FilterVestingEvents retrieves the events from the vesting bridge on Ethereum starting at startAt, transform them into ChainEvent, and pass it to the OnEventFound callback. The properties startAt and stopAt are inclusive.
type OnEventFound ¶
type OnEventFound func(*commandspb.ChainEvent)