testutil

package
v7.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TestOwnerAddress defines a reusable bech32 address for testing purposes
	TestOwnerAddress = "neutron17dtl0mjt3t77kpuhg2edqzjpszulwhgzcdvagh"

	TestInterchainID = "owner_id"

	ConnectionZero = "connection-0"

	// TestVersion defines a reusable interchainaccounts version string for testing purposes
	TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{
		Version:                icatypes.Version,
		ControllerConnectionId: ConnectionZero,
		HostConnectionId:       ConnectionZero,
		Encoding:               icatypes.EncodingProtobuf,
		TxType:                 icatypes.TxTypeSDKMultiMsg,
	}))
)

Functions

func GenesisStateWithValSet

func GenesisStateWithValSet(
	codec codec.Codec,
	genesisState map[string]json.RawMessage,
	valSet *tmtypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) (map[string]json.RawMessage, error)

GenesisStateWithValSet returns a new genesis state with the validator set

func NewICAPath

func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path

func NewProviderConsumerCoordinator

func NewProviderConsumerCoordinator(t *testing.T) *ibctesting.Coordinator

NewCoordinator initializes Coordinator with interchain security dummy provider and 2 neutron consumer chains

func NewTransferPath

func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path

func RegisterInterchainAccount

func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error

RegisterInterchainAccount is a helper function for starting the channel handshake

func Setup

func Setup(t *testing.T) ibctesting.TestingApp

func SetupICAPath

func SetupICAPath(path *ibctesting.Path, owner string) error

SetupICAPath invokes the InterchainAccounts entrypoint and subsequent channel handshake handlers

func SetupTestingApp

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

SetupTestingApp initializes the IBC-go testing application

func SetupTransferPath

func SetupTransferPath(path *ibctesting.Path) error

SetupTransferPath

func SetupWithGenesisValSet

func SetupWithGenesisValSet(
	t *testing.T,
	valSet *tmtypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	chainID string,
	balances ...banktypes.Balance,
) ibctesting.TestingApp

SetupWithGenesisValSet initializes a new SimApp with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit in the default token of the simapp from first genesis account. A Nop logger is set in SimApp.

func SignAndDeliver

func SignAndDeliver(
	tb testing.TB,
	txCfg client.TxConfig,
	app *baseapp.BaseApp,
	msgs []sdk.Msg,
	chainID string,
	accNums, accSeqs []uint64,
	blockTime time.Time,
	nextValHash []byte,
	priv ...types2.PrivKey,
) (res *cometbfttypes.ResponseFinalizeBlock, err error)

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

Types

type IBCConnectionTestSuite

type IBCConnectionTestSuite struct {
	suite.Suite
	Coordinator *ibctesting.Coordinator

	// testing chains used for convenience and readability
	ChainProvider *ibctesting.TestChain
	ChainA        *ibctesting.TestChain
	ChainB        *ibctesting.TestChain
	ChainC        *ibctesting.TestChain

	Path         *ibctesting.Path
	TransferPath *ibctesting.Path

	TransferPathAC *ibctesting.Path
}

func (*IBCConnectionTestSuite) ConfigureTransferChannel

func (suite *IBCConnectionTestSuite) ConfigureTransferChannel()

func (*IBCConnectionTestSuite) ConfigureTransferChannelAC

func (suite *IBCConnectionTestSuite) ConfigureTransferChannelAC()

func (*IBCConnectionTestSuite) ExecuteContract

func (suite *IBCConnectionTestSuite) ExecuteContract(contract, sender sdk.AccAddress, msg []byte, funds sdk.Coins) ([]byte, error)

func (*IBCConnectionTestSuite) FundAcc

func (suite *IBCConnectionTestSuite) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)

func (*IBCConnectionTestSuite) FundModuleAcc

func (suite *IBCConnectionTestSuite) FundModuleAcc(moduleName string, amounts sdk.Coins)

FundModuleAcc funds target modules with specified amount.

func (*IBCConnectionTestSuite) GetNeutronZoneApp

func (suite *IBCConnectionTestSuite) GetNeutronZoneApp(chain *ibctesting.TestChain) *app.App

func (*IBCConnectionTestSuite) InstantiateTestContract

func (suite *IBCConnectionTestSuite) InstantiateTestContract(ctx sdk.Context, funder sdk.AccAddress, codeID uint64) sdk.AccAddress

func (*IBCConnectionTestSuite) SendMsgsNoCheck

func (suite *IBCConnectionTestSuite) SendMsgsNoCheck(chain *ibctesting.TestChain, msgs ...sdk.Msg) (*cometbfttypes.ExecTxResult, 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 (*IBCConnectionTestSuite) SetupTest

func (suite *IBCConnectionTestSuite) SetupTest()

func (*IBCConnectionTestSuite) StoreTestCode

func (suite *IBCConnectionTestSuite) StoreTestCode(ctx sdk.Context, addr sdk.AccAddress, path string) uint64

Directories

Path Synopsis
common
nullify
Package nullify provides methods to init nil values structs for test assertion.
Package nullify provides methods to init nil values structs for test assertion.
contractmanager
cron
dex
dynamicfees
feeburner
feerefunder
globalfee
harpoon
interchainqueries
interchaintxs
contractmanager/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
cron/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
feeburner/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
feerefunder/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
harpoon/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
interchainqueries/keeper
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
interchainqueries/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
interchaintxs/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
revenue/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
transfer/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
revenue
tokenfactory
transfer

Jump to

Keyboard shortcuts

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