gwrelayer

package
v0.0.0-...-7be3494 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubmitVAAToContract

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

SubmitVAAToContract submits a VAA to the smart contract on deltachain.

Types

type GatewayRelayer

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

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

func NewGatewayRelayer

func NewGatewayRelayer(
	ctx context.Context,
	logger *zap.Logger,
	ibcTranslatorAddress string,
	deltachainConn GatewayRelayerDeltachainConn,
	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 GatewayRelayerDeltachainConn

type GatewayRelayerDeltachainConn 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 deltachain accountant smart contract.

type VaaType

type VaaType uint8

GatewayRelayer is the object that manages the interface to the deltachain 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