gwrelayer

package
v0.0.0-...-b93a54a Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubmitVAAToContract

func SubmitVAAToContract(
	ctx context.Context,
	logger *zap.Logger,
	wormchainConn GatewayRelayerWormchainConn,
	v2p *VaaToPublish,
) (*sdktx.BroadcastTxResponse, error)

SubmitVAAToContract submits a VAA to the smart contract on wormchain.

Types

type GatewayRelayer

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

GatewayRelayer is the object that manages the interface to the wormchain accountant smart contract.

func NewGatewayRelayer

func NewGatewayRelayer(
	ctx context.Context,
	logger *zap.Logger,
	ibcTranslatorAddress string,
	wormchainConn GatewayRelayerWormchainConn,
	env common.Environment,
) *GatewayRelayer

NewGatewayRelayer creates a new instance of the GatewayRelayer object.

func (*GatewayRelayer) Close

func (gwr *GatewayRelayer) Close()

Close closes the connection to the smart contract.

func (*GatewayRelayer) Start

func (gwr *GatewayRelayer) Start(ctx context.Context) error

Start initializes the gateway relayer and starts the worker runnable that submits VAAs to the contract.

func (*GatewayRelayer) SubmitVAA

func (gwr *GatewayRelayer) SubmitVAA(v *vaa.VAA)

SubmitVAA checks to see if the VAA should be submitted to the smart contract, and if so, writes it to the channel for publishing.

type GatewayRelayerWormchainConn

type GatewayRelayerWormchainConn interface {
	Close()
	SenderAddress() string
	SubmitQuery(ctx context.Context, contractAddress string, query []byte) ([]byte, error)
	SignAndBroadcastTx(ctx context.Context, msg sdktypes.Msg) (*sdktx.BroadcastTxResponse, error)
	BroadcastTxResponseToString(txResp *sdktx.BroadcastTxResponse) string
}

type VaaToPublish

type VaaToPublish struct {
	V               *vaa.VAA
	ContractAddress string
	VType           VaaType
}

GatewayRelayer is the object that manages the interface to the wormchain accountant smart contract.

type VaaType

type VaaType uint8

GatewayRelayer is the object that manages the interface to the wormchain accountant smart contract.

const (
	IbcTranslator VaaType = iota
	TokenBridge
)

Jump to

Keyboard shortcuts

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