Documentation ¶
Index ¶
- Variables
- func ERC20MessageHandler(m *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)
- func ERC721MessageHandler(msg *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)
- func GenericMessageHandler(msg *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)
- type BridgeContract
- type ChainClient
- type EVMMessageHandler
- type EVMVoter
- type HandlerMatcher
- type MessageHandler
- type MessageHandlerFunc
Constants ¶
This section is empty.
Variables ¶
var (
Sleep = time.Sleep
)
Functions ¶
func ERC20MessageHandler ¶
func ERC721MessageHandler ¶
Types ¶
type BridgeContract ¶
type BridgeContract interface { IsProposalVotedBy(by common.Address, p *proposal.Proposal) (bool, error) VoteProposal(proposal *proposal.Proposal, opts transactor.TransactOptions) (*common.Hash, error) SimulateVoteProposal(proposal *proposal.Proposal) error ProposalStatus(p *proposal.Proposal) (message.ProposalStatus, error) GetThreshold() (uint8, error) IsFeeClaimThresholdReached() (bool, error) RelayerClaimFees( destDomainID uint8, opts transactor.TransactOptions, ) (*common.Hash, error) }
type ChainClient ¶
type ChainClient interface { RelayerAddress() common.Address CallContract(ctx context.Context, callArgs map[string]interface{}, blockNumber *big.Int) ([]byte, error) SubscribePendingTransactions(ctx context.Context, ch chan<- common.Hash) (*rpc.ClientSubscription, error) TransactionByHash(ctx context.Context, hash common.Hash) (tx *ethereumTypes.Transaction, isPending bool, err error) calls.ContractCallerDispatcher }
type EVMMessageHandler ¶
type EVMMessageHandler struct {
// contains filtered or unexported fields
}
func NewEVMMessageHandler ¶
func NewEVMMessageHandler(handlerMatcher HandlerMatcher) *EVMMessageHandler
NewEVMMessageHandler creates an instance of EVMMessageHandler that contains message handler functions for converting deposit message into a chain specific proposal
func (*EVMMessageHandler) HandleMessage ¶
func (*EVMMessageHandler) MatchAddressWithHandlerFunc ¶
func (mh *EVMMessageHandler) MatchAddressWithHandlerFunc(addr common.Address) (MessageHandlerFunc, error)
func (*EVMMessageHandler) RegisterMessageHandler ¶
func (mh *EVMMessageHandler) RegisterMessageHandler(address string, handler MessageHandlerFunc)
RegisterEventHandler registers an message handler by associating a handler function to a specified address
type EVMVoter ¶
type EVMVoter struct {
// contains filtered or unexported fields
}
func NewVoter ¶
func NewVoter(mh MessageHandler, client ChainClient, bridgeContract BridgeContract) *EVMVoter
NewVoter creates an instance of EVMVoter that votes for proposal on chain.
It is created without pending proposal subscription and is a fallback for nodes that don't support pending transaction subscription and will vote on proposals that already satisfy threshold.
func NewVoterWithSubscription ¶
func NewVoterWithSubscription(mh MessageHandler, client ChainClient, bridgeContract BridgeContract) (*EVMVoter, error)
NewVoterWithSubscription creates an instance of EVMVoter that votes for proposals on chain.
It is created with a pending proposal subscription that listens to pending voteProposal transactions and avoids wasting gas on sending votes for transactions that will fail. Currently, officially supported only by Geth nodes.
func (*EVMVoter) Execute ¶
Execute checks if relayer already voted and is threshold satisfied and casts a vote if it isn't.