testutil

package
v5.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	One   = 1
	Two   = 2
	Three = 3
	Four  = 4
)

Variables

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

	TestInterchainID = "owner_id"

	// provider-consumer connection takes connection-0
	ConnectionOne = "connection-1"

	// TestVersion defines a reusable interchainaccounts version string for testing purposes
	TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{
		Version:                icatypes.Version,
		ControllerConnectionId: ConnectionOne,
		HostConnectionId:       ConnectionOne,
		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, chainProvider *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, chainProvider *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 SetupCCVPath

func SetupCCVPath(path *ibctesting.Path, suite *IBCConnectionTestSuite)

update CCV path with correct info

func SetupICAPath

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

SetupICAPath invokes the InterchainAccounts entrypoint and subsequent channel handshake handlers

func SetupTestingApp

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

SetupTestingApp initializes the IBC-go testing application

func SetupTransferPath

func SetupTransferPath(path *ibctesting.Path) error

SetupTransferPath

func SetupValSetAppIniter

func SetupValSetAppIniter(initValUpdates []cometbfttypes.ValidatorUpdate) icssimapp.AppIniter

SetupValSetAppIniter is a simple wrapper for ICS e2e tests to satisfy interface

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 ...cryptotypes.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

	ProviderApp e2e.ProviderApp
	ChainAApp   e2e.ConsumerApp
	ChainBApp   e2e.ConsumerApp
	ChainCApp   e2e.ConsumerApp

	CCVPathA       *ibctesting.Path
	CCVPathB       *ibctesting.Path
	CCVPathC       *ibctesting.Path
	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 added in v5.0.2

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

func (suite *IBCConnectionTestSuite) SetupCCVChannels()

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
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.
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.
transfer/types
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.
tokenfactory
transfer

Jump to

Keyboard shortcuts

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