utils

package
v1.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDecodedTxs

func GetDecodedTxs(txDecoder sdk.TxDecoder, txs [][]byte) ([]sdk.Tx, error)

GetDecodedTxs returns the decoded transactions from the given bytes.

func GetEncodedTxs added in v1.1.0

func GetEncodedTxs(txEncoder sdk.TxEncoder, txs []sdk.Tx) ([][]byte, error)

GetEncodedTxs returns the encoded transactions from the given bytes.

func GetTxHash added in v1.3.0

func GetTxHash(encoder sdk.TxEncoder, tx sdk.Tx) (string, error)

GetTxHash returns the string hash representation of a transaction.

func RemoveTxsFromLane

func RemoveTxsFromLane(txs []sdk.Tx, mempool sdkmempool.Mempool) error

RemoveTxsFromLane removes the transactions from the given lane's mempool.

Types

type TxWithInfo added in v1.3.0

type TxWithInfo struct {
	// Hash is the hex-encoded hash of the transaction.
	Hash string
	// Size is the size of the transaction in bytes.
	Size int64
	// GasLimit is the gas limit of the transaction.
	GasLimit uint64
	// TxBytes is the bytes of the transaction.
	TxBytes []byte
	// Priority defines the priority of the transaction.
	Priority any
	// Signers defines the signers of a transaction.
	Signers []signerextraction.SignerData
}

TxWithInfo contains the information required for a transaction to be included in a proposal.

func NewTxInfo added in v1.3.0

func NewTxInfo(
	hash string,
	size int64,
	gasLimit uint64,
	txBytes []byte,
	priority any,
	signers []signerextraction.SignerData,
) TxWithInfo

NewTxInfo returns a new TxInfo instance.

func (TxWithInfo) String added in v1.3.0

func (t TxWithInfo) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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