Documentation ¶
Index ¶
- Variables
- func MessageEventsForTransaction(ctx context.Context, ethConn Connector, contract eth_common.Address, ...) (uint64, []*common.MessagePublication, error)
- func PadAddress(address common.Address) vaa.Address
- type BlockPollConnector
- type Connector
- type EthereumConnector
- func (e *EthereumConnector) Client() *ethClient.Client
- func (e *EthereumConnector) ContractAddress() ethCommon.Address
- func (e *EthereumConnector) GetCurrentGuardianSetIndex(ctx context.Context) (uint32, error)
- func (e *EthereumConnector) GetGuardianSet(ctx context.Context, index uint32) (ethAbi.StructsGuardianSet, error)
- func (e *EthereumConnector) NetworkName() string
- func (e *EthereumConnector) ParseLogMessagePublished(log ethTypes.Log) (*ethAbi.AbiLogMessagePublished, error)
- func (e *EthereumConnector) RawCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (e *EthereumConnector) SubscribeForBlocks(ctx context.Context, sink chan<- *NewBlock) (ethereum.Subscription, error)
- func (e *EthereumConnector) TimeOfBlockByHash(ctx context.Context, hash ethCommon.Hash) (uint64, error)
- func (e *EthereumConnector) TransactionReceipt(ctx context.Context, txHash ethCommon.Hash) (*ethTypes.Receipt, error)
- func (e *EthereumConnector) WatchLogMessagePublished(ctx context.Context, sink chan<- *ethAbi.AbiLogMessagePublished) (ethEvent.Subscription, error)
- type MoonbeamFinalizer
- type NewBlock
- type PollSubscription
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsubscribed = errors.New("unsubscribed")
View Source
var ( // SECURITY: Hardcoded ABI identifier for the LogMessagePublished topic. When using the watcher, we don't need this // since the node will only hand us pre-filtered events. In this case, we need to manually verify it // since ParseLogMessagePublished will only verify whether it parses. // keccak256("LogMessagePublished(address,uint16,uint64,uint32,bytes,uint8)") LogMessagePublishedTopic = eth_common.HexToHash("0xcd7b525350dfac7e06deb9b3a8f19ceb75cf6cd2914cd0b2d7bf9d9a3d9babff") )
Functions ¶
func MessageEventsForTransaction ¶
func MessageEventsForTransaction( ctx context.Context, ethConn Connector, contract eth_common.Address, chainId vaa.ChainID, tx eth_common.Hash) (uint64, []*common.MessagePublication, error)
MessageEventsForTransaction returns the lockup events for a given transaction. Returns the block number and a list of MessagePublication events.
Types ¶
type BlockPollConnector ¶
type BlockPollConnector struct { Connector Delay time.Duration // contains filtered or unexported fields }
BlockPollConnector polls for new blocks instead of subscribing when using SubscribeForBlocks
func NewBlockPollConnector ¶
func (*BlockPollConnector) DisablePoller ¶
func (b *BlockPollConnector) DisablePoller()
func (*BlockPollConnector) EnablePoller ¶
func (b *BlockPollConnector) EnablePoller()
func (*BlockPollConnector) SubscribeForBlocks ¶
func (b *BlockPollConnector) SubscribeForBlocks(ctx context.Context, sink chan<- *NewBlock) (ethereum.Subscription, error)
type Connector ¶
type Connector interface { NetworkName() string ContractAddress() common.Address GetCurrentGuardianSetIndex(ctx context.Context) (uint32, error) GetGuardianSet(ctx context.Context, index uint32) (abi.StructsGuardianSet, error) WatchLogMessagePublished(ctx context.Context, sink chan<- *abi.AbiLogMessagePublished) (event.Subscription, error) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) TimeOfBlockByHash(ctx context.Context, hash common.Hash) (uint64, error) ParseLogMessagePublished(log types.Log) (*abi.AbiLogMessagePublished, error) SubscribeForBlocks(ctx context.Context, sink chan<- *NewBlock) (ethereum.Subscription, error) RawCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error }
Connector exposes Wormhole-specific interactions with an EVM-based network
type EthereumConnector ¶
type EthereumConnector struct {
// contains filtered or unexported fields
}
EthereumConnector implements EVM network query capabilities for go-ethereum based networks and networks supporting the standard web3 rpc.
func NewEthereumConnector ¶
func (*EthereumConnector) Client ¶
func (e *EthereumConnector) Client() *ethClient.Client
func (*EthereumConnector) ContractAddress ¶
func (e *EthereumConnector) ContractAddress() ethCommon.Address
func (*EthereumConnector) GetCurrentGuardianSetIndex ¶
func (e *EthereumConnector) GetCurrentGuardianSetIndex(ctx context.Context) (uint32, error)
func (*EthereumConnector) GetGuardianSet ¶
func (e *EthereumConnector) GetGuardianSet(ctx context.Context, index uint32) (ethAbi.StructsGuardianSet, error)
func (*EthereumConnector) NetworkName ¶
func (e *EthereumConnector) NetworkName() string
func (*EthereumConnector) ParseLogMessagePublished ¶
func (e *EthereumConnector) ParseLogMessagePublished(log ethTypes.Log) (*ethAbi.AbiLogMessagePublished, error)
func (*EthereumConnector) RawCallContext ¶
func (e *EthereumConnector) RawCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
func (*EthereumConnector) SubscribeForBlocks ¶
func (e *EthereumConnector) SubscribeForBlocks(ctx context.Context, sink chan<- *NewBlock) (ethereum.Subscription, error)
func (*EthereumConnector) TimeOfBlockByHash ¶
func (*EthereumConnector) TransactionReceipt ¶
func (*EthereumConnector) WatchLogMessagePublished ¶
func (e *EthereumConnector) WatchLogMessagePublished(ctx context.Context, sink chan<- *ethAbi.AbiLogMessagePublished) (ethEvent.Subscription, error)
type MoonbeamFinalizer ¶
type MoonbeamFinalizer struct {
// contains filtered or unexported fields
}
func (*MoonbeamFinalizer) DialContext ¶
func (f *MoonbeamFinalizer) DialContext(ctx context.Context, rawurl string) (err error)
func (*MoonbeamFinalizer) IsBlockFinalized ¶
type PollSubscription ¶
type PollSubscription struct {
// contains filtered or unexported fields
}
func NewPollSubscription ¶
func NewPollSubscription() *PollSubscription
func (*PollSubscription) Err ¶
func (sub *PollSubscription) Err() <-chan error
func (*PollSubscription) Unsubscribe ¶
func (sub *PollSubscription) Unsubscribe()
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewEthWatcher ¶
func NewEthWatcher( url string, contract eth_common.Address, networkName string, readiness readiness.Component, chainID vaa.ChainID, messageEvents chan *common.MessagePublication, setEvents chan *common.GuardianSet, obsvReqC chan *gossipv1.ObservationRequest, unsafeDevMode bool, pollIntervalMs *uint, waitForConfirmations bool, ) *Watcher
func (*Watcher) SetWaitForConfirmations ¶
SetWaitForConfirmations is used to override whether we should wait for the number of confirmations specified by the consistencyLevel in the message.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.