blobfactory

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComplexBlobTxWithOtherMsgs

func ComplexBlobTxWithOtherMsgs(t *testing.T, kr keyring.Keyring, enc sdk.TxEncoder, chainid, account string, msgs ...sdk.Msg) coretypes.Tx

func CreateRawTx

func CreateRawTx(txConfig client.TxConfig, msg sdk.Msg, signer *blobtypes.KeyringSigner, opts ...blobtypes.TxBuilderOption) []byte

func GenerateManyRawSendTxs

func GenerateManyRawSendTxs(txConfig client.TxConfig, count int) []coretypes.Tx

func GenerateRawSendTx

func GenerateRawSendTx(txConfig client.TxConfig, signer *blobtypes.KeyringSigner, amount int64) (rawTx []byte)

GenerateRawSendTx creates send transactions meant to help test encoding/prepare/process proposal, they are not meant to actually be executed by the state machine. If we want that, we have to update nonce, and send funds to someone other than the same account signing the transaction.

func IndexWrappedTxWithInvalidNamespace

func IndexWrappedTxWithInvalidNamespace(
	t *testing.T,
	enc sdk.TxEncoder,
	signer *blobtypes.KeyringSigner,
	sequence uint64,
	accountNum uint64,
	index uint32,
) (coretypes.Tx, tmproto.Blob)

IndexWrappedTxWithInvalidNamespace returns an index wrapped PFB tx with an invalid namespace and a blob associated with that index wrapped PFB tx.

func ManyBlobs

func ManyBlobs(t *testing.T, namespaces []appns.Namespace, sizes []int) []*tmproto.Blob

func ManyMultiBlobTx

func ManyMultiBlobTx(
	t *testing.T,
	enc sdk.TxEncoder,
	kr keyring.Keyring,
	chainid string,
	accounts []string,
	accInfos []AccountInfo,
	blobs [][]*tmproto.Blob,
) [][]byte

func ManyMultiBlobTxSameSigner

func ManyMultiBlobTxSameSigner(
	t *testing.T,
	enc sdk.TxEncoder,
	signer *blobtypes.KeyringSigner,
	blobSizes [][]int,
	sequence, accountNum uint64,
) []coretypes.Tx

ManyMultiBlobTxSameSigner generates and returns many blob transactions with the possibility to add more than one blob. The sequence and account number are manually set, and the sequence is manually incremented when doing so.

func ManyRandBlobs

func ManyRandBlobs(t *testing.T, sizes ...int) []*tmproto.Blob

func ManyRandBlobsIdenticallySized

func ManyRandBlobsIdenticallySized(t *testing.T, count, size int) []*tmproto.Blob

func MultiBlobTx

func MultiBlobTx(
	t *testing.T,
	enc sdk.TxEncoder,
	signer *blobtypes.KeyringSigner,
	sequence uint64,
	accountNum uint64,
	blobs ...*tmproto.Blob,
) coretypes.Tx

func NestedBlobs

func NestedBlobs(t *testing.T, namespaces []appns.Namespace, sizes [][]int) [][]*tmproto.Blob

func RandBlobTxs

func RandBlobTxs(enc sdk.TxEncoder, count, blobsPerTx, size int) coretypes.Txs

func RandBlobTxsRandomlySized

func RandBlobTxsRandomlySized(enc sdk.TxEncoder, count, maxSize, maxBlobs int) coretypes.Txs

func RandBlobTxsWithAccounts

func RandBlobTxsWithAccounts(
	enc sdk.TxEncoder,
	kr keyring.Keyring,
	conn *grpc.ClientConn,
	size int,
	blobCount int,
	randSize bool,
	chainid string,
	accounts []string,
) []coretypes.Tx

RandBlobTxsWithAccounts will create random blob transactions using the provided configuration. If no grpc connection is provided, then it will not update the account info. One blob transaction is generated per account provided.

func RandBlobTxsWithNamespaces

func RandBlobTxsWithNamespaces(enc sdk.TxEncoder, namespaces []appns.Namespace, sizes []int) []coretypes.Tx

func RandBlobTxsWithNamespacesAndSigner

func RandBlobTxsWithNamespacesAndSigner(
	enc sdk.TxEncoder,
	signer *blobtypes.KeyringSigner,
	namespaces []appns.Namespace,
	sizes []int,
) []coretypes.Tx

func RandBlobsWithNamespace

func RandBlobsWithNamespace(namespaces []appns.Namespace, sizes []int) []*tmproto.Blob

func RandMsgPayForBlobs

func RandMsgPayForBlobs(size int) (*blobtypes.MsgPayForBlobs, *tmproto.Blob)

func RandMsgPayForBlobsWithNamespaceAndSigner

func RandMsgPayForBlobsWithNamespaceAndSigner(signer string, ns appns.Namespace, size int) (*blobtypes.MsgPayForBlobs, *tmproto.Blob)

func RandMsgPayForBlobsWithSigner

func RandMsgPayForBlobsWithSigner(singer string, size, blobCount int) (*blobtypes.MsgPayForBlobs, []*tmproto.Blob)

func Repeat

func Repeat[T any](s T, count int) []T

Types

type AccountInfo

type AccountInfo struct {
	AccountNum, Sequence uint64
}

func ExtractAccountInfo

func ExtractAccountInfo(accs []authtypes.AccountI) []AccountInfo

Jump to

Keyboard shortcuts

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