transactor

package
v0.0.0-...-77861b7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryAccount

func QueryAccount(cliCtx client.Context, sgnAddr string) (account *authtypes.BaseAccount, err error)

Types

type MsgQueue

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

func (*MsgQueue) Len

func (q *MsgQueue) Len() int

func (*MsgQueue) PopFront

func (q *MsgQueue) PopFront() sdk.Msg

func (*MsgQueue) PushBack

func (q *MsgQueue) PushBack(msg sdk.Msg)

func (*MsgQueue) PushFront

func (q *MsgQueue) PushFront(msg sdk.Msg)

type Transactor

type Transactor struct {
	TxFactory clienttx.Factory
	CliCtx    client.Context
	Key       keyring.Info

	GrpcConn *grpc.ClientConn
	// contains filtered or unexported fields
}

func NewCliTransactor

func NewCliTransactor(homeDir string, legacyAmino *codec.LegacyAmino, cdc codec.Codec, interfaceRegistry codectypes.InterfaceRegistry) (*Transactor, error)

func NewTransactor

func NewTransactor(
	homeDir, chainID, nodeURI, accAddr, passphrase string,
	legacyAmino *codec.LegacyAmino,
	cdc codec.Codec,
	interfaceRegistry codectypes.InterfaceRegistry,
) (*Transactor, error)

func NewTransactorWithCliCtx

func NewTransactorWithCliCtx(cliCtx client.Context) (*Transactor, error)

func NewTransactorWithGrpc

func NewTransactorWithGrpc(
	homeDir, chainID, nodeURI, accAddr, passphrase, grpcUrl string,
	legacyAmino *codec.LegacyAmino,
	cdc codec.Codec,
	interfaceRegistry codectypes.InterfaceRegistry,
) (*Transactor, error)

func (*Transactor) AddTxMsg

func (t *Transactor) AddTxMsg(msg sdk.Msg)

AddTxMsg add msg into a queue before actual broadcast

func (*Transactor) LockSendTx

func (t *Transactor) LockSendTx(msg sdk.Msg) (*sdk.TxResponse, error)

send a single msg so one fail won't affect others. this is only intended for initwithdraw/signagain request, if x/cbr return err, we return it immediately (wrapped in sendTxMsgs fmt.Errorf) if nil err, caller should query later. No waitmine note due to inherent async of estimategas and actual include in block, it's possible even this returns nil err, x/cbr still fails lock to ensure req are serialized even gateway handle concurrent initwithdraw from clients

func (*Transactor) LockSendTxs

func (t *Transactor) LockSendTxs(msgs []sdk.Msg) (*sdk.TxResponse, error)

func (*Transactor) WaitDone

func (t *Transactor) WaitDone()

blocks until the msg queue is emptied

type TransactorPool

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

func NewTransactorPool

func NewTransactorPool(homeDir, chainID string, legacyAmino *codec.LegacyAmino, cdc codec.Codec, interfaceRegistry codectypes.InterfaceRegistry) *TransactorPool

func (*TransactorPool) AddTransactor

func (tp *TransactorPool) AddTransactor(transactor *Transactor)

Add transactors to the pool

func (*TransactorPool) AddTransactors

func (tp *TransactorPool) AddTransactors(nodeURI, passphrase string, addrs []string) error

Add transactors to the pool

func (*TransactorPool) AddTransactorsWithGrpc

func (tp *TransactorPool) AddTransactorsWithGrpc(nodeURI, passphrase, grpcUrl string, addrs []string) error

Add transactors to the pool

func (*TransactorPool) GetTransactor

func (tp *TransactorPool) GetTransactor() *Transactor

Get a transactor from the pool

Jump to

Keyboard shortcuts

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