listener

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyTransaction

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

func NewEmptyTransaction

func NewEmptyTransaction(chainId *big.Int, tx common.Hash, data []byte, from, to *common.Address) *EmptyTransaction

func (*EmptyTransaction) GetData

func (b *EmptyTransaction) GetData() []byte

func (*EmptyTransaction) GetFromAddress

func (b *EmptyTransaction) GetFromAddress() string

func (*EmptyTransaction) GetHash

func (b *EmptyTransaction) GetHash() common.Hash

func (*EmptyTransaction) GetToAddress

func (b *EmptyTransaction) GetToAddress() string

func (*EmptyTransaction) GetValue

func (b *EmptyTransaction) GetValue() *big.Int

type EthBlock

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

func NewEthBlock

func NewEthBlock(client utils.EthClient, chainId *big.Int, block *ethtypes.Block, getLogs bool) (*EthBlock, error)

func (*EthBlock) GetHash

func (b *EthBlock) GetHash() common.Hash

func (*EthBlock) GetHeight

func (b *EthBlock) GetHeight() uint64

func (*EthBlock) GetLogs

func (b *EthBlock) GetLogs() []bridgeCore.Log

func (*EthBlock) GetTimestamp

func (b *EthBlock) GetTimestamp() uint64

func (*EthBlock) GetTransactions

func (b *EthBlock) GetTransactions() []bridgeCore.Transaction

type EthCallbackJob

type EthCallbackJob struct {
	*bridgeCore.BaseJob
	// contains filtered or unexported fields
}

func NewEthCallbackJob

func NewEthCallbackJob(listener bridgeCore.Listener, method string, tx bridgeCore.Transaction, data []byte, fromChainID *big.Int, helpers utils.Utils) *EthCallbackJob

func (*EthCallbackJob) Process

func (e *EthCallbackJob) Process() ([]byte, error)

func (*EthCallbackJob) Save

func (e *EthCallbackJob) Save(status string) error

func (*EthCallbackJob) Update

func (e *EthCallbackJob) Update(status string) error

type EthListenJob

type EthListenJob struct {
	*bridgeCore.BaseJob
}

func NewEthListenJob

func NewEthListenJob(jobType int, listener bridgeCore.Listener, subscriptionName string, tx bridgeCore.Transaction, data []byte) *EthListenJob

func (*EthListenJob) Process added in v0.2.6

func (e *EthListenJob) Process() ([]byte, error)

type EthLog

type EthLog ethtypes.Log

func (*EthLog) GetContractAddress

func (e *EthLog) GetContractAddress() string

func (*EthLog) GetData

func (e *EthLog) GetData() []byte

func (*EthLog) GetIndex

func (e *EthLog) GetIndex() uint

func (*EthLog) GetTopics

func (e *EthLog) GetTopics() (topics []string)

func (*EthLog) GetTransactionHash

func (e *EthLog) GetTransactionHash() string

func (*EthLog) GetTxIndex

func (e *EthLog) GetTxIndex() uint

type EthTransaction

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

func NewEthTransaction

func NewEthTransaction(chainId *big.Int, tx *ethtypes.Transaction) (*EthTransaction, error)

func NewEthTransactionWithoutError

func NewEthTransactionWithoutError(chainId *big.Int, tx *ethtypes.Transaction) *EthTransaction

func (*EthTransaction) GetData

func (b *EthTransaction) GetData() []byte

func (*EthTransaction) GetFromAddress

func (b *EthTransaction) GetFromAddress() string

func (*EthTransaction) GetHash

func (b *EthTransaction) GetHash() common.Hash

func (*EthTransaction) GetToAddress

func (b *EthTransaction) GetToAddress() string

func (*EthTransaction) GetValue

func (b *EthTransaction) GetValue() *big.Int

type EthereumListener

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

func NewEthereumListener

func NewEthereumListener(ctx context.Context, cfg *bridgeCore.LsConfig, helpers utils.Utils, store stores.MainStore, pool *bridgeCore.Pool) (*EthereumListener, error)

func (*EthereumListener) AddListeners

func (e *EthereumListener) AddListeners(m map[string]bridgeCore.Listener)

func (*EthereumListener) AddTask

func (e *EthereumListener) AddTask(task bridgeCore.TaskHandler)

func (*EthereumListener) CacheBlocks added in v0.2.3

func (e *EthereumListener) CacheBlocks(blockNumbers map[uint64]struct{})

func (*EthereumListener) Close

func (e *EthereumListener) Close()

func (*EthereumListener) Config

func (e *EthereumListener) Config() *bridgeCore.LsConfig

func (*EthereumListener) Context

func (e *EthereumListener) Context() context.Context

func (*EthereumListener) GetBlock

func (e *EthereumListener) GetBlock(height uint64) (bridgeCore.Block, error)

func (*EthereumListener) GetBlockWithLogs

func (e *EthereumListener) GetBlockWithLogs(height uint64) (bridgeCore.Block, error)

func (*EthereumListener) GetBridgeOperatorSign added in v0.2.4

func (e *EthereumListener) GetBridgeOperatorSign() bridgeCoreUtils.ISign

func (*EthereumListener) GetChainID

func (e *EthereumListener) GetChainID() (*big.Int, error)

func (*EthereumListener) GetCurrentBlock

func (e *EthereumListener) GetCurrentBlock() bridgeCore.Block

func (*EthereumListener) GetEthClient

func (e *EthereumListener) GetEthClient() utils.EthClient

func (*EthereumListener) GetInitHeight

func (e *EthereumListener) GetInitHeight() uint64

func (*EthereumListener) GetLatestBlock

func (e *EthereumListener) GetLatestBlock() (bridgeCore.Block, error)

func (*EthereumListener) GetLatestBlockHeight

func (e *EthereumListener) GetLatestBlockHeight() (uint64, error)

func (*EthereumListener) GetLegacyBridgeOperatorSign added in v0.2.4

func (e *EthereumListener) GetLegacyBridgeOperatorSign() bridgeCoreUtils.ISign

func (*EthereumListener) GetListenHandleJob

func (e *EthereumListener) GetListenHandleJob(subscriptionName string, tx bridgeCore.Transaction, eventId string, data []byte) bridgeCore.JobHandler

func (*EthereumListener) GetListener

func (e *EthereumListener) GetListener(s string) bridgeCore.Listener

func (*EthereumListener) GetName

func (e *EthereumListener) GetName() string

func (*EthereumListener) GetProcessedBlock

func (e *EthereumListener) GetProcessedBlock() (bridgeCore.Block, error)

func (*EthereumListener) GetReceipt

func (e *EthereumListener) GetReceipt(txHash common.Hash) (*ethtypes.Receipt, error)

func (*EthereumListener) GetRelayerSign

func (e *EthereumListener) GetRelayerSign() bridgeCoreUtils.ISign

func (*EthereumListener) GetSafeBlockRange

func (e *EthereumListener) GetSafeBlockRange() uint64

func (*EthereumListener) GetStore

func (e *EthereumListener) GetStore() stores.MainStore

func (*EthereumListener) GetSubscriptions

func (e *EthereumListener) GetSubscriptions() map[string]*bridgeCore.Subscribe

func (*EthereumListener) GetTask

func (e *EthereumListener) GetTask(index int) bridgeCore.TaskHandler

func (*EthereumListener) GetTasks

func (e *EthereumListener) GetTasks() []bridgeCore.TaskHandler

func (*EthereumListener) GetVoterSign

func (e *EthereumListener) GetVoterSign() bridgeCoreUtils.ISign

func (*EthereumListener) IsDisabled

func (e *EthereumListener) IsDisabled() bool

func (*EthereumListener) IsUpTodate

func (e *EthereumListener) IsUpTodate() bool

func (*EthereumListener) NewJobFromDB

func (*EthereumListener) Period

func (e *EthereumListener) Period() time.Duration

func (*EthereumListener) SaveCurrentBlockToDB

func (e *EthereumListener) SaveCurrentBlockToDB() error

func (*EthereumListener) SaveTransactionsToDB

func (e *EthereumListener) SaveTransactionsToDB(txs []bridgeCore.Transaction) error

func (*EthereumListener) SendCallbackJobs

func (e *EthereumListener) SendCallbackJobs(listeners map[string]bridgeCore.Listener, subscriptionName string, tx bridgeCore.Transaction, inputData []byte)

func (*EthereumListener) SetInitHeight

func (e *EthereumListener) SetInitHeight(height uint64)

func (*EthereumListener) SetPrepareJobChan

func (e *EthereumListener) SetPrepareJobChan(jobChan chan bridgeCore.JobHandler)

func (*EthereumListener) Start

func (e *EthereumListener) Start()

func (*EthereumListener) UpdateCurrentBlock

func (e *EthereumListener) UpdateCurrentBlock(block bridgeCore.Block) error

type RoninCallBackJob

type RoninCallBackJob struct {
	*EthCallbackJob
}

type RoninListener

type RoninListener struct {
	*EthereumListener
	// contains filtered or unexported fields
}

func NewRoninListener

func NewRoninListener(ctx context.Context, cfg *bridgeCore.LsConfig, helpers utils.Utils, store bridgeCoreStores.MainStore, pool *bridgeCore.Pool) (*RoninListener, error)

func (*RoninListener) BridgeOperatorSetUpdatedCallback

func (l *RoninListener) BridgeOperatorSetUpdatedCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*RoninListener) BridgeOperatorsApprovedCallback

func (l *RoninListener) BridgeOperatorsApprovedCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*RoninListener) DepositRequestedCallback

func (l *RoninListener) DepositRequestedCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*RoninListener) IsUpTodate

func (l *RoninListener) IsUpTodate() bool

func (*RoninListener) NewJobFromDB

func (l *RoninListener) NewJobFromDB(job *bridgeCoreModels.Job) (bridgeCore.JobHandler, error)

func (*RoninListener) ProvideReceiptSignatureAgainCallback

func (l *RoninListener) ProvideReceiptSignatureAgainCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*RoninListener) ProvideReceiptSignatureCallback

func (l *RoninListener) ProvideReceiptSignatureCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*RoninListener) StoreMainchainWithdrawCallback

func (l *RoninListener) StoreMainchainWithdrawCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

StoreMainchainWithdrawCallback stores the receipt to own database for future check from ProvideReceiptSignatureCallback

func (*RoninListener) WithdrewCallback

func (l *RoninListener) WithdrewCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

Jump to

Keyboard shortcuts

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