{"modulePath":"github.com/VaivalGithub/chainsafe-core","version":"v1.0.76","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\n## Variables\n\n```go\nvar (\n\tSleep = time.Sleep\n)\n```\n\n## Functions\n\n```go\nfunc ERC20MessageHandler(m *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)\n```\n\n```go\nfunc ERC721MessageHandler(msg *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)\n```\n\n```go\nfunc GenericMessageHandler(msg *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)\n```\n\n## Types\n\n```go\ntype BridgeContract interface {\n\tIsProposalVotedBy(by common.Address, p *proposal.Proposal) (bool, error)\n\tVoteProposal(proposal *proposal.Proposal, opts transactor.TransactOptions) (*common.Hash, error)\n\tSimulateVoteProposal(proposal *proposal.Proposal) error\n\tProposalStatus(p *proposal.Proposal) (message.ProposalStatus, error)\n\tGetThreshold() (uint8, error)\n}\n```\n\n```go\ntype ChainClient interface {\n\tRelayerAddress() common.Address\n\tCallContract(ctx context.Context, callArgs map[string]interface{}, blockNumber *big.Int) ([]byte, error)\n\tSubscribePendingTransactions(ctx context.Context, ch chan\u003c- common.Hash) (*rpc.ClientSubscription, error)\n\tTransactionByHash(ctx context.Context, hash common.Hash) (tx *ethereumTypes.Transaction, isPending bool, err error)\n\tcalls.ContractCallerDispatcher\n}\n```\n\n```go\ntype EVMMessageHandler struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewEVMMessageHandler(handlerMatcher HandlerMatcher) *EVMMessageHandler\n```\nNewEVMMessageHandler creates an instance of EVMMessageHandler that contains message handler functions for converting deposit message into a chain specific proposal\n\n```go\nfunc (mh *EVMMessageHandler) HandleMessage(m *message.Message) (*proposal.Proposal, error)\n```\n\n```go\nfunc (mh *EVMMessageHandler) MatchAddressWithHandlerFunc(addr common.Address) (MessageHandlerFunc, error)\n```\n\n```go\nfunc (mh *EVMMessageHandler) RegisterMessageHandler(address string, handler MessageHandlerFunc)\n```\nRegisterEventHandler registers an message handler by associating a handler function to a specified address\n\n```go\ntype EVMVoter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewVoter(mh MessageHandler, client ChainClient, bridgeContract BridgeContract) *EVMVoter\n```\nNewVoter creates an instance of EVMVoter that votes for proposal on chain.\n\nIt 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.\n\n```go\nfunc NewVoterWithSubscription(mh MessageHandler, client ChainClient, bridgeContract BridgeContract) (*EVMVoter, error)\n```\nNewVoterWithSubscription creates an instance of EVMVoter that votes for proposals on chain.\n\nIt 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.\n\n```go\nfunc (v *EVMVoter) Execute(m *message.Message, opts transactor.TransactOptions) error\n```\nExecute checks if relayer already voted and is threshold satisfied and casts a vote if it isn't.\n\n```go\ntype HandlerMatcher interface {\n\tGetHandlerAddressForResourceID(resourceID types.ResourceID) (common.Address, error)\n\tContractAddress() *common.Address\n}\n```\n\n```go\ntype MessageHandler interface {\n\tHandleMessage(m *message.Message) (*proposal.Proposal, error)\n}\n```\n\n```go\ntype MessageHandlerFunc func(m *message.Message, handlerAddr, bridgeAddress common.Address) (*proposal.Proposal, error)\n```\n\n","path":"github.com/VaivalGithub/chainsafe-core/chains/evm/executor","name":"executor","synopsis":"","isRedistributable":true}
