relayer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func SetPriceFeeder

func SetPriceFeeder(pf *coingecko.PriceFeed) func(PeggyRelayer)

Types

type BridgeValidators

type BridgeValidators []*types.BridgeValidator

func (BridgeValidators) GetPowers

func (b BridgeValidators) GetPowers() []uint64

GetPowers returns only the power values for all members

func (BridgeValidators) HasDuplicates

func (b BridgeValidators) HasDuplicates() bool

HasDuplicates returns true if there are duplicates in the set

func (BridgeValidators) Sort

func (b BridgeValidators) Sort()

Sort sorts the validators by power

type PeggyRelayer

type PeggyRelayer interface {
	Start(ctx context.Context) error

	FindLatestValset(ctx context.Context) (*peggytypes.Valset, error)

	RelayBatches(
		ctx context.Context,
		currentValset *peggytypes.Valset,
		possibleBatches map[common.Address][]SubmittableBatch,
	) error

	RelayValsets(ctx context.Context, currentValset *peggytypes.Valset) error

	// SetPriceFeeder sets the (optional) price feeder used when performing profitable
	// batch calculations.
	SetPriceFeeder(*coingecko.PriceFeed)
}

func NewPeggyRelayer

func NewPeggyRelayer(
	logger zerolog.Logger,
	peggyQueryClient peggytypes.QueryClient,
	peggyContract peggy.Contract,
	valsetRelayEnabled bool,
	batchRelayEnabled bool,
	loopDuration time.Duration,
	pendingTxWait time.Duration,
	profitMultiplier float64,
	options ...func(PeggyRelayer),
) PeggyRelayer

type PeggyValsetUpdatedEvents

type PeggyValsetUpdatedEvents []*wrappers.PeggyValsetUpdatedEvent

func (PeggyValsetUpdatedEvents) Len

func (a PeggyValsetUpdatedEvents) Len() int

func (PeggyValsetUpdatedEvents) Less

func (a PeggyValsetUpdatedEvents) Less(i, j int) bool

func (PeggyValsetUpdatedEvents) Swap

func (a PeggyValsetUpdatedEvents) Swap(i, j int)

type SubmittableBatch

type SubmittableBatch struct {
	Batch      *types.OutgoingTxBatch
	Signatures []*types.MsgConfirmBatch
}

Jump to

Keyboard shortcuts

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