forwarders

package
v2.11.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 20 Imported by: 0 modules, 0 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

func FilterName added in v2.1.0

func FilterName(addr common.Address) string

Types

type Config

type Config interface {
	FinalityDepth() uint32
}

type DbORM added in v2.11.0

type DbORM struct {
	// contains filtered or unexported fields
}

func NewORM

func NewORM(db sqlutil.DataSource) *DbORM

func (*DbORM) CreateForwarder added in v2.11.0

func (o *DbORM) CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (fwd Forwarder, err error)

CreateForwarder creates the Forwarder address associated with the current EVM chain id.

func (*DbORM) DeleteForwarder added in v2.11.0

func (o *DbORM) DeleteForwarder(ctx context.Context, id int64, cleanup func(tx sqlutil.DataSource, evmChainID int64, addr common.Address) error) (err error)

DeleteForwarder removes a forwarder address. If cleanup is non-nil, it can be used to perform any chain- or contract-specific cleanup that need to happen atomically on forwarder deletion. If cleanup returns an error, forwarder deletion will be aborted.

func (*DbORM) FindForwarders added in v2.11.0

func (o *DbORM) FindForwarders(ctx context.Context, offset, limit int) (fwds []Forwarder, count int, err error)

FindForwarders returns all forwarder addresses from offset up until limit.

func (*DbORM) FindForwardersByChain added in v2.11.0

func (o *DbORM) FindForwardersByChain(ctx context.Context, evmChainId big.Big) (fwds []Forwarder, err error)

FindForwardersByChain returns all forwarder addresses for a chain.

func (*DbORM) FindForwardersInListByChain added in v2.11.0

func (o *DbORM) FindForwardersInListByChain(ctx context.Context, evmChainId big.Big, addrs []common.Address) ([]Forwarder, error)

func (*DbORM) Transaction added in v2.11.0

func (o *DbORM) Transaction(ctx context.Context, fn func(*DbORM) error) (err error)

type Forwarder

type Forwarder struct {
	ID         int64
	Address    common.Address
	EVMChainID big.Big
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Forwarder is the struct for Forwarder Addresses

type FwdMgr

type FwdMgr struct {
	services.StateMachine
	ORM ORM
	// contains filtered or unexported fields
}

func NewFwdMgr

func NewFwdMgr(db sqlutil.DataSource, client evmclient.Client, logpoller evmlogpoller.LogPoller, l logger.Logger, cfg Config) *FwdMgr

func (*FwdMgr) Close

func (f *FwdMgr) Close() error

Stop cancels all outgoings calls and stops internal ticker loop.

func (*FwdMgr) ConvertPayload

func (f *FwdMgr) ConvertPayload(dest common.Address, origPayload []byte) ([]byte, error)

func (*FwdMgr) ForwarderFor

func (f *FwdMgr) ForwarderFor(addr common.Address) (forwarder common.Address, err error)

func (*FwdMgr) HealthReport

func (f *FwdMgr) HealthReport() map[string]error

func (*FwdMgr) Name

func (f *FwdMgr) Name() string

func (*FwdMgr) Start

func (f *FwdMgr) Start(ctx context.Context) error

Start starts Forwarder Manager.

type ORM

type ORM interface {
	CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (fwd Forwarder, err error)
	FindForwarders(ctx context.Context, offset, limit int) ([]Forwarder, int, error)
	FindForwardersByChain(ctx context.Context, evmChainId big.Big) ([]Forwarder, error)
	DeleteForwarder(ctx context.Context, id int64, cleanup func(tx sqlutil.DataSource, evmChainId int64, addr common.Address) error) error
	FindForwardersInListByChain(ctx context.Context, evmChainId big.Big, addrs []common.Address) ([]Forwarder, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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