Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInsufficientVotingPowerToPass = errors.New("insufficient voting power")
)
Functions ¶
func EncodeTxBatchConfirm ¶
func EncodeTxBatchConfirm(gravityID string, batch types.OutgoingTxBatch) ethcmn.Hash
EncodeTxBatchConfirm takes the required input data and produces the required signature to confirm a transaction batch on the Gravity Ethereum contract. This value will then be signed before being submitted to Cosmos, verified, and then relayed to Ethereum.
func EncodeValsetConfirm ¶
EncodeValsetConfirm takes the required input data and produces the required signature to confirm a validator set update on the Gravity Ethereum contract. This value will then be signed before being submitted to Cosmos, verified, and then relayed to Ethereum.
Types ¶
type Contract ¶
type Contract interface { committer.EVMCommitter // Address returns the Gravity contract address Address() ethcmn.Address // EncodeTransactionBatch encodes a batch into a tx byte data. This is specially helpful for estimating gas and // detecting identical transactions in the mempool. EncodeTransactionBatch( ctx context.Context, currentValset types.Valset, batch types.OutgoingTxBatch, confirms []types.MsgConfirmBatch, ) ([]byte, error) // EncodeValsetUpdate encodes a valset update into a tx byte data. This is specially helpful for estimating gas and // detecting identical transactions in the mempool. EncodeValsetUpdate( ctx context.Context, oldValset types.Valset, newValset types.Valset, confirms []types.MsgValsetConfirm, ) ([]byte, error) GetTxBatchNonce( ctx context.Context, erc20ContractAddress ethcmn.Address, callerAddress ethcmn.Address, ) (*big.Int, error) GetValsetNonce( ctx context.Context, callerAddress ethcmn.Address, ) (*big.Int, error) GetGravityID( ctx context.Context, callerAddress ethcmn.Address, ) (string, error) GetERC20Symbol( ctx context.Context, erc20ContractAddress ethcmn.Address, callerAddress ethcmn.Address, ) (symbol string, err error) GetERC20Decimals( ctx context.Context, erc20ContractAddress ethcmn.Address, callerAddress ethcmn.Address, ) (decimals uint8, err error) // SubscribeToPendingTxs starts a websocket connection to Alchemy's service that listens for new pending txs made // to the Gravity contract. SubscribeToPendingTxs(ctx context.Context, alchemyWebsocketURL string) error // IsPendingTxInput returns true if the input data is found in the pending tx list. If the tx is found but the tx is // older than pendingTxWaitDuration, we consider it stale and return false, so the validator re-sends it. IsPendingTxInput(txData []byte, pendingTxWaitDuration time.Duration) bool GetPendingTxInputList() *PendingTxInputList }
type PendingTxInput ¶
PendingTxInput contains the data of a pending transaction and the time we first saw it.
type PendingTxInputList ¶
type PendingTxInputList []PendingTxInput
func (*PendingTxInputList) AddPendingTxInput ¶
func (p *PendingTxInputList) AddPendingTxInput(pendingTx *RPCTransaction)
AddPendingTxInput adds pending submitBatch and updateBatch calls to the Gravity contract to the list of pending transactions, any other transaction is ignored.
type RPCTransaction ¶
RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction
type RepackedSigs ¶
type RepackedSigs struct {
// contains filtered or unexported fields
}