testutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 43 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"

	// 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 added in v1.1.0

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 GetTestConsumerAdditionProp added in v0.2.0

func GetTestConsumerAdditionProp(chain *ibctesting.TestChain) *providertypes.ConsumerAdditionProposal

func NewICAPath

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

func NewProviderConsumerCoordinator added in v0.2.0

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

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

func NewTestChain added in v0.2.0

func NewTestChain(t *testing.T, coord *legacyibctesting.Coordinator, appIniter legacyibctesting.AppIniter, chainID string) *legacyibctesting.TestChain

NewTestChain initializes a new test chain with a default of 4 validators Use this function if the tests do not need custom control over the validator set Copypasted from https://github.com/cosmos/ibc-go/blob/af9b461c63274b9ce5917beb89a2c92e865419df/testing/chain.go#L159

func NewTestChainWithValSet added in v0.2.0

func NewTestChainWithValSet(t *testing.T, coord *legacyibctesting.Coordinator, appIniter legacyibctesting.AppIniter, chainID string, valSet *tmtypes.ValidatorSet, signers map[string]tmtypes.PrivValidator) *legacyibctesting.TestChain

NewTestChainWithValSet copypasted and modified to use neutron denom from here https://github.com/cosmos/ibc-go/blob/af9b461c63274b9ce5917beb89a2c92e865419df/testing/chain.go#L94

func NewTransferPath added in v0.2.0

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 added in v1.1.0

func Setup(t *testing.T) *app.App

func SetupCCVPath added in v0.2.0

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() func() (ibctesting.TestingApp, map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application

func SetupTransferPath added in v0.2.0

func SetupTransferPath(path *ibctesting.Path) error

SetupTransferPath

func SetupWithGenesisValSet added in v1.1.0

func SetupWithGenesisValSet(
	t *testing.T,
	valSet *tmtypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) *app.App

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.

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

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

	CCVPathA     *ibctesting.Path
	CCVPathB     *ibctesting.Path
	Path         *ibctesting.Path
	TransferPath *ibctesting.Path
}

func (*IBCConnectionTestSuite) ConfigureTransferChannel added in v0.2.0

func (suite *IBCConnectionTestSuite) ConfigureTransferChannel()

func (*IBCConnectionTestSuite) FundAcc added in v0.3.0

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

func (*IBCConnectionTestSuite) GetNeutronZoneApp

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

func (*IBCConnectionTestSuite) InstantiateTestContract added in v1.1.0

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

func (*IBCConnectionTestSuite) SetupCCVChannels added in v0.2.0

func (suite *IBCConnectionTestSuite) SetupCCVChannels()

func (*IBCConnectionTestSuite) SetupTest

func (suite *IBCConnectionTestSuite) SetupTest()

func (*IBCConnectionTestSuite) StoreTestCode added in v1.1.0

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

Directories

Path Synopsis
common
contractmanager
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.
cron
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.
dex
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.
feeburner
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.
feerefunder
interchainqueries
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.
interchaintxs
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/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.
transfer

Jump to

Keyboard shortcuts

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