bridge

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAdminRole   = "DefaultAdmin"
	BridgeRelayerRole  = "BridgeRelayer"
	BridgeRetrierRole  = "BridgeRetrier"
	BridgeOperatorRole = "BridgeOperator"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeClient

type BridgeClient struct {
	Client *ethclient.Client
	Bridge *contracts.BridgeContract
	Cfg    contracts.BridgeNetworkConfig
	// contains filtered or unexported fields
}

BridgeClient holds all the contract of a Bridge.

func NewBridgeSuite

func NewBridgeSuite(cfg contracts.BridgeNetworkConfig, log logger.Logger) (*BridgeClient, error)

NewBridgeSuite creates a new BridgeClient with the given parameters.

func (*BridgeClient) DomainID

func (c *BridgeClient) DomainID() uint8
func (c *BridgeClient) FormatAddressLink(address string) string
func (c *BridgeClient) FormatTxHashLink(txHash string) string

func (*BridgeClient) ListenToTxs

func (c *BridgeClient) ListenToTxs(ctx context.Context, resultChan chan interface{}, _ *big.Int)

ListenToTxs retrieves all events for the current bridge.

func (*BridgeClient) Roles

func (c *BridgeClient) Roles() map[ethCommon.Hash]string

type BridgeConfig

type BridgeConfig struct {
	common.BaseConfig
	Chains map[string]contracts.BridgeNetworkConfig
}

func DefaultConfig

func DefaultConfig() BridgeConfig

func (*BridgeConfig) IsValid

func (cfg *BridgeConfig) IsValid() (bool, error)

type BridgeProcessor

type BridgeProcessor struct {
	*processorCommon.BaseProcessor
	// contains filtered or unexported fields
}

func NewBridgeProcessor

func NewBridgeProcessor(cfg BridgeConfig,
	db *store.Store,
	log logger.Logger,
) (*BridgeProcessor, error)

func (*BridgeProcessor) Process

func (p *BridgeProcessor) Process(ctx context.Context, msg EventMsg) error

func (*BridgeProcessor) Queue

func (p *BridgeProcessor) Queue(msg interface{})

func (*BridgeProcessor) Start

func (p *BridgeProcessor) Start(ctx context.Context)

type DepositMsg

type DepositMsg struct {
	From        string
	To          string
	FromNetwork string
	ToNetwork   string
	Token       string
	TokenName   string
	TokenSymbol string
	Amount      float64
	TxHash      string
}

func (DepositMsg) String

func (msg DepositMsg) String() string

type EventMsg

type EventMsg struct {
	DomainID uint8
	Event    common.EVMEvent
}

type RelayerAddedMsg

type RelayerAddedMsg struct {
	Network       string
	Relayer       string
	TotalRelayers uint64
	TxHash        string
}

func (RelayerAddedMsg) String

func (msg RelayerAddedMsg) String() string

type RelayerRemovedMsg

type RelayerRemovedMsg struct {
	Network       string
	Relayer       string
	TotalRelayers uint64
	TxHash        string
}

func (RelayerRemovedMsg) String

func (msg RelayerRemovedMsg) String() string

type RetryMsg

type RetryMsg struct {
	Network   string
	TxToRetry string
	TxHash    string
}

func (RetryMsg) String

func (msg RetryMsg) String() string

type RoleGrantedMsg

type RoleGrantedMsg struct {
	Network  string
	Operator string
	Grantee  string
	Role     string
	TxHash   string
}

func (RoleGrantedMsg) String

func (msg RoleGrantedMsg) String() string

type RoleRevokedMsg

type RoleRevokedMsg struct {
	Network        string
	Operator       string
	RevokedAddress string
	Role           string
	TxHash         string
}

func (RoleRevokedMsg) String

func (msg RoleRevokedMsg) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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