osmosisibctesting

package
v25.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

README

Osmosis IBC Testing

This package provides helpers, for overriding components of ibctesting.

Tracked components we override:

  • Adding consensus minimum fees for sent messages
  • Adding SendMsgsNoCheck as a replacement for SendMsgs but without asserting the results as a success. This allows us to test errors.
  • Adding a SignAndDeliver function as a replacement of simapp.SignAndDeliver that does not require an instance of testing.Testing and will return the results instead of asserting success or failure.

Documentation

Index

Constants

View Source
const SimAppChainID = "simulation-app"

Variables

This section is empty.

Functions

func SetupTestingApp

func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)

func SignAndDeliver

func SignAndDeliver(
	txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg,
	chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error)

SignAndDeliver signs and delivers a transaction without asserting the results. This overrides the function from ibctesting

func SignAndDeliverWithAuthenticator

func SignAndDeliverWithAuthenticator(
	txCfg client.TxConfig,
	app *baseapp.BaseApp,
	header tmproto.Header,
	msgs []sdk.Msg,
	chainID string,
	accNums,
	accSeqs []uint64,
	signers, signatures []cryptotypes.PrivKey,
	selectedAuthenticators []uint64,
) (sdk.GasInfo, *sdk.Result, error)

SignAndDeliver signs and delivers a transaction without asserting the results. This overrides the function from ibctesting

func SignAndDeliverWithAuthenticatorAndCompoundSigs

func SignAndDeliverWithAuthenticatorAndCompoundSigs(
	txCfg client.TxConfig,
	app *baseapp.BaseApp,
	header tmproto.Header,
	msgs []sdk.Msg,
	chainID string,
	accNums, accSeqs []uint64,
	signers []cryptotypes.PrivKey,
	signatures [][]cryptotypes.PrivKey,
	selectedAuthenticators []uint64,
) (sdk.GasInfo, *sdk.Result, error)

func SignAuthenticatorMsg

func SignAuthenticatorMsg(
	gen client.TxConfig,
	msgs []sdk.Msg,
	feeAmt sdk.Coins,
	gas uint64,
	chainID string,
	accNums, accSeqs []uint64,
	signers, signatures []cryptotypes.PrivKey,
	selectedAuthenticators []uint64,
) (sdk.Tx, error)

GenTx generates a signed mock transaction.

func SignAuthenticatorMsgWithCompoundSigs

func SignAuthenticatorMsgWithCompoundSigs(
	gen client.TxConfig,
	msgs []sdk.Msg,
	feeAmt sdk.Coins,
	gas uint64,
	chainID string,
	accNums, accSeqs []uint64,
	signers []cryptotypes.PrivKey,
	signatures [][]cryptotypes.PrivKey,
	selectedAuthenticators []uint64,
) (sdk.Tx, error)

SignAuthenticatorMsgWithCompoundSigs generates a transaction signed with compound signatures.

Types

type TestChain

type TestChain struct {
	*ibctesting.TestChain
}

func (*TestChain) GetOsmosisApp

func (chain *TestChain) GetOsmosisApp() *app.OsmosisApp

GetOsmosisApp returns the current chain's app as an OsmosisApp

func (*TestChain) InstantiateContract

func (chain *TestChain) InstantiateContract(suite *suite.Suite, msg string, codeID uint64) sdk.AccAddress

func (*TestChain) InstantiateRLContract

func (chain *TestChain) InstantiateRLContract(suite *suite.Suite, quotas string) sdk.AccAddress

func (*TestChain) MoveEpochsToTheFuture

func (chain *TestChain) MoveEpochsToTheFuture() error

Move epochs to the future to avoid issues with minting

func (*TestChain) QueryContract

func (chain *TestChain) QueryContract(suite *suite.Suite, contract sdk.AccAddress, key []byte) string

func (*TestChain) QueryContractJson

func (chain *TestChain) QueryContractJson(suite *suite.Suite, contract sdk.AccAddress, key []byte) gjson.Result

func (*TestChain) RegisterRateLimitingContract

func (chain *TestChain) RegisterRateLimitingContract(addr []byte)

func (*TestChain) SendMsgsFromPrivKeys

func (chain *TestChain) SendMsgsFromPrivKeys(privKeys []cryptotypes.PrivKey, msgs ...sdk.Msg) (*sdk.Result, error)

SendMsgsNoCheck is an alternative to ibctesting.TestChain.SendMsgs so that it doesn't check for errors. That should be handled by the caller

func (*TestChain) SendMsgsFromPrivKeysWithAuthenticator

func (chain *TestChain) SendMsgsFromPrivKeysWithAuthenticator(
	signers, signatures []cryptotypes.PrivKey,
	selectedAuthenticators []uint64,
	msgs ...sdk.Msg,
) (*sdk.Result, error)

SendMsgsNoCheck is an alternative to ibctesting.TestChain.SendMsgs so that it doesn't check for errors. That should be handled by the caller

func (*TestChain) SendMsgsFromPrivKeysWithAuthenticatorAndCompoundSigs

func (chain *TestChain) SendMsgsFromPrivKeysWithAuthenticatorAndCompoundSigs(
	signers []cryptotypes.PrivKey,
	signatures [][]cryptotypes.PrivKey,
	selectedAuthenticators []uint64,
	msgs ...sdk.Msg,
) (*sdk.Result, error)

func (*TestChain) SendMsgsNoCheck

func (chain *TestChain) SendMsgsNoCheck(msgs ...sdk.Msg) (*sdk.Result, error)

SendMsgsNoCheck is an alternative to ibctesting.TestChain.SendMsgs so that it doesn't check for errors. That should be handled by the caller

func (*TestChain) StoreContractCode

func (chain *TestChain) StoreContractCode(suite *suite.Suite, path string)

func (*TestChain) StoreContractCodeDirect

func (chain *TestChain) StoreContractCodeDirect(suite *suite.Suite, path string) uint64

Jump to

Keyboard shortcuts

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