integration

package module
v0.0.0-...-461f88c Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInterchain

func BuildInterchain(t *testing.T, ctx context.Context, chain ibc.Chain) *interchaintest.Interchain

BuildInterchain creates a new Interchain testing env with the configured Block SDK CosmosChain

func ChainBuilderFromChainSpec

func ChainBuilderFromChainSpec(t *testing.T, spec *interchaintest.ChainSpec) ibc.Chain

ChainBuilderFromChainSpec creates an interchaintest chain builder factory given a ChainSpec and returns the associated chain

func RandLowerCaseLetterString

func RandLowerCaseLetterString(length int) string

RandLowerCaseLetterString returns a lowercase letter string of given length

func TxHash

func TxHash(tx []byte) string

Types

type KeyringOverride

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

type TestSuite

type TestSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

TestSuite runs the feemarket integration test-suite against a given interchaintest specification

func NewIntegrationTestSuiteFromSpec

func NewIntegrationTestSuiteFromSpec(spec *interchaintest.ChainSpec) *TestSuite

func (*TestSuite) Block

func (s *TestSuite) Block(chain *cosmos.CosmosChain, height int64) *rpctypes.ResultBlock

Block returns the block at the given height

func (*TestSuite) BroadcastTxs

func (s *TestSuite) BroadcastTxs(ctx context.Context, chain *cosmos.CosmosChain, txs []Tx) [][]byte

BroadcastTxs broadcasts the given messages for each user. This function returns the broadcasted txs. If a message is not expected to be included in a block, set SkipInclusionCheck to true and the method will not block on the tx's inclusion in a block, otherwise this method will block on the tx's inclusion

func (*TestSuite) BroadcastTxsWithCallback

func (s *TestSuite) BroadcastTxsWithCallback(
	ctx context.Context,
	chain *cosmos.CosmosChain,
	txs []Tx,
	cb func(tx []byte, resp *rpctypes.ResultTx),
) [][]byte

BroadcastTxsWithCallback broadcasts the given messages for each user. This function returns the broadcasted txs. If a message is not expected to be included in a block, set SkipInclusionCheck to true and the method will not block on the tx's inclusion in a block, otherwise this method will block on the tx's inclusion. The callback function is called for each tx that is included in a block.

func (*TestSuite) CreateTx

func (s *TestSuite) CreateTx(ctx context.Context, chain *cosmos.CosmosChain, user cosmos.User, seqIncrement, height uint64, GasPrice int64, msgs ...sdk.Msg) []byte

CreateTx creates a new transaction to be signed by the given user, including a provided set of messages

func (*TestSuite) ExecTx

func (s *TestSuite) ExecTx(ctx context.Context, chain *cosmos.CosmosChain, keyName string, command ...string) (string, error)

func (*TestSuite) GetAndFundTestUserWithMnemonic

func (s *TestSuite) GetAndFundTestUserWithMnemonic(
	ctx context.Context,
	keyNamePrefix, mnemonic string,
	amount int64,
	chain *cosmos.CosmosChain,
) (ibc.Wallet, error)

GetAndFundTestUserWithMnemonic restores a user using the given mnemonic and funds it with the native chain denom. The caller should wait for some blocks to complete before the funds will be accessible.

func (*TestSuite) GetAndFundTestUsers

func (s *TestSuite) GetAndFundTestUsers(
	ctx context.Context,
	keyNamePrefix string,
	amount int64,
	chains ...*cosmos.CosmosChain,
) []ibc.Wallet

GetAndFundTestUsers generates and funds chain users with the native chain denom. The caller should wait for some blocks to complete before the funds will be accessible.

func (*TestSuite) QueryAccountBalance

func (s *TestSuite) QueryAccountBalance(chain ibc.Chain, address, denom string) int64

QueryAccountBalance queries a given account's balance on the chain

func (*TestSuite) QueryAccountSequence

func (s *TestSuite) QueryAccountSequence(chain *cosmos.CosmosChain, address string) uint64

QueryAccountSequence

func (*TestSuite) QueryParams

func (s *TestSuite) QueryParams() types.Params

func (*TestSuite) QueryValidators

func (s *TestSuite) QueryValidators(chain *cosmos.CosmosChain) []sdk.ValAddress

QueryValidators queries for all the network's validators

func (*TestSuite) SetupSubTest

func (s *TestSuite) SetupSubTest()

func (*TestSuite) SetupSuite

func (s *TestSuite) SetupSuite()

func (*TestSuite) SimulateTx

func (s *TestSuite) SimulateTx(ctx context.Context, chain *cosmos.CosmosChain, user cosmos.User, height uint64, expectFail bool, msgs ...sdk.Msg)

SimulateTx simulates the provided messages, and checks whether the provided failure condition is met

func (*TestSuite) TearDownSuite

func (s *TestSuite) TearDownSuite()

func (*TestSuite) TestQueryParams

func (s *TestSuite) TestQueryParams()

func (*TestSuite) VerifyBlock

func (s *TestSuite) VerifyBlock(block *rpctypes.ResultBlock, offset int, bidTxHash string, txs [][]byte)

VerifyBlock takes a Block and verifies that it contains the given bid at the 0-th index, and the bundled txs immediately after

func (*TestSuite) VerifyBlockWithExpectedBlock

func (s *TestSuite) VerifyBlockWithExpectedBlock(chain *cosmos.CosmosChain, height uint64, txs [][]byte)

VerifyBlockWithExpectedBlock takes in a list of raw tx bytes and compares each tx hash to the tx hashes in the block. The expected block is the block that should be returned by the chain at the given height.

func (*TestSuite) WaitForHeight

func (s *TestSuite) WaitForHeight(chain *cosmos.CosmosChain, height uint64)

WaitForHeight waits for the chain to reach the given height

func (*TestSuite) WithDenom

func (s *TestSuite) WithDenom(denom string) *TestSuite

func (*TestSuite) WithKeyringOptions

func (s *TestSuite) WithKeyringOptions(cdc codec.Codec, opts keyring.Option)

type Tx

type Tx struct {
	User               cosmos.User
	Msgs               []sdk.Msg
	GasPrice           int64
	SequenceIncrement  uint64
	Height             uint64
	SkipInclusionCheck bool
	ExpectFail         bool
}

Jump to

Keyboard shortcuts

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