e2e

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSidecarToNode added in v1.2.0

func AddSidecarToNode(node *cosmos.ChainNode, conf ibc.SidecarConfig)

AddSidecarToNode adds the sidecar configured by the given config to the given node. These are configured so that the sidecar is started before the node is started.

func CCVChainConstructor added in v1.1.0

func CCVChainConstructor(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos.CosmosChain

CCVChainConstructor is a constructor for the CCV chain

func DefaultChainConstructor

func DefaultChainConstructor(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos.CosmosChain

DefaultChainConstructor is the default construct of a chan that will be used in the feemarket integration tests. There is only a single chain that is created.

func DefaultMarketMap added in v1.2.0

func DefaultMarketMap() mmtypes.MarketMap

func DefaultOracleConfig added in v1.2.0

func DefaultOracleConfig(url string) oracleconfig.OracleConfig

func DefaultOracleSidecar added in v1.2.0

func DefaultOracleSidecar(image ibc.DockerImage) ibc.SidecarConfig

func GetOracleSideCar added in v1.2.0

func GetOracleSideCar(node *cosmos.ChainNode) *cosmos.SidecarProcess

func RestartOracle added in v1.2.0

func RestartOracle(node *cosmos.ChainNode) error

RestartOracle restarts the oracle sidecar for a given node

func SetOracleConfigsOnApp added in v1.2.0

func SetOracleConfigsOnApp(node *cosmos.ChainNode)

SetOracleConfigsOnApp writes the oracle configuration to the given node's application config.

func SetOracleConfigsOnOracle added in v1.2.0

func SetOracleConfigsOnOracle(
	oracle *cosmos.SidecarProcess,
	oracleCfg oracleconfig.OracleConfig,
)

SetOracleConfigsOnOracle writes the oracle and metrics configs to the given node's oracle sidecar.

func StartOracle added in v1.2.0

func StartOracle(node *cosmos.ChainNode) error

StartOracle starts the oracle sidecar for a given node

func StopOracle added in v1.2.0

func StopOracle(node *cosmos.ChainNode) error

StopOracle stops the oracle sidecar for a given node

func TxHash

func TxHash(tx []byte) string

Types

type CCVInterchain added in v1.1.0

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

func (*CCVInterchain) IBCPath added in v1.1.0

func (c *CCVInterchain) IBCPath() string

func (*CCVInterchain) Relayer added in v1.1.0

func (c *CCVInterchain) Relayer() ibc.Relayer

func (*CCVInterchain) Reporter added in v1.1.0

type ChainConstructor

type ChainConstructor func(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos.CosmosChain

ChainConstructor returns the chain that will be using slinky, as well as any additional chains that are needed for the test. The first chain returned will be the chain that is used in the slinky integration tests.

type Interchain

type Interchain interface {
	Relayer() ibc.Relayer
	Reporter() *testreporter.RelayerExecReporter
	IBCPath() string
}

Interchain is an interface representing the set of chains that are used in the slinky e2e tests, as well as any additional relayer / ibc-path information

func CCVInterchainConstructor added in v1.1.0

func CCVInterchainConstructor(ctx context.Context, t *testing.T, chains []*cosmos.CosmosChain) Interchain

CCVInterchainConstructor is a constructor for the CCV interchain

func DefaultInterchainConstructor

func DefaultInterchainConstructor(ctx context.Context, t *testing.T, chains []*cosmos.CosmosChain) Interchain

DefaultInterchainConstructor is the default constructor of an interchain that will be used in the feemarket integration tests.

type InterchainConstructor

type InterchainConstructor func(ctx context.Context, t *testing.T, chains []*cosmos.CosmosChain) Interchain

InterchainConstructor returns an interchain that will be used in the feemarket integration tests. The chains used in the interchain constructor should be the chains constructed via the ChainConstructor

type KeyringOverride

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

type Option

type Option func(*TestSuite)

Option is a function that modifies the TestSuite

func WithAuthority

func WithAuthority(addr sdk.AccAddress) Option

WithAuthority sets the authority address

func WithBlockTime

func WithBlockTime(t time.Duration) Option

WithBlockTime sets the block time

func WithChainConstructor

func WithChainConstructor(cc ChainConstructor) Option

WithChainConstructor sets the chain constructor

func WithDenom

func WithDenom(denom string) Option

WithDenom sets the token denom

func WithInterchainConstructor

func WithInterchainConstructor(ic InterchainConstructor) Option

WithInterchainConstructor sets the interchain constructor

type TestSuite

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

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

func NewIntegrationSuite

func NewIntegrationSuite(spec *interchaintest.ChainSpec, oracleImage ibc.DockerImage, opts ...Option) *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) CreateTx

func (s *TestSuite) CreateTx(chain *cosmos.CosmosChain, user cosmos.User, fee string, gas 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, blocking bool, command ...string) (string, error)

ExecTx executes a cli command on a node, waits a block and queries the Tx to verify it was included on chain.

func (*TestSuite) GetAndFundTestUserWithMnemonic

func (s *TestSuite) GetAndFundTestUserWithMnemonic(
	ctx context.Context,
	keyNamePrefix, mnemonic string,
	amount int64,
	chain ibc.Chain,
) (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,
	chain ibc.Chain,
) 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

func (*TestSuite) QueryDefaultGasPrice

func (s *TestSuite) QueryDefaultGasPrice() sdk.DecCoin

func (*TestSuite) QueryParams

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

func (*TestSuite) QueryState

func (s *TestSuite) QueryState() types.State

func (*TestSuite) QueryValidators

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

QueryValidators queries for all the network's validators

func (*TestSuite) SendCoins

func (s *TestSuite) SendCoins(ctx context.Context, keyName, sender, receiver string, amt, fees sdk.Coins, gas int64) (string, error)

SendCoins creates a executes a SendCoins message and broadcasts the transaction.

func (*TestSuite) SendCoinsMultiBroadcast

func (s *TestSuite) SendCoinsMultiBroadcast(ctx context.Context, sender, receiver ibc.Wallet, amt, fees sdk.Coins, gas int64, numMsg int) (*coretypes.ResultBroadcastTxCommit, error)

func (*TestSuite) SetupSubTest

func (s *TestSuite) SetupSubTest()

func (*TestSuite) SetupSuite

func (s *TestSuite) SetupSuite()

func (*TestSuite) SimulateTx

func (s *TestSuite) SimulateTx(ctx context.Context, 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) Teardown

func (s *TestSuite) Teardown()

func (*TestSuite) TestQueryGasPrice

func (s *TestSuite) TestQueryGasPrice()

func (*TestSuite) TestQueryParams

func (s *TestSuite) TestQueryParams()

func (*TestSuite) TestQueryState

func (s *TestSuite) TestQueryState()

func (*TestSuite) TestSendTxDecrease

func (s *TestSuite) TestSendTxDecrease()

TestSendTxDecrease tests that the feemarket will decrease until it hits the min gas price when gas utilization is below the target block utilization.

func (*TestSuite) TestSendTxIncrease

func (s *TestSuite) TestSendTxIncrease()

TestSendTxIncrease tests that the feemarket will increase when gas utilization is above the target block utilization.

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 int64)

WaitForHeight waits for the chain to reach the given height

func (*TestSuite) WithKeyringOptions

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

Jump to

Keyboard shortcuts

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