testutil

package
v4.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 46 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

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.

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

func (suite *IBCConnectionTestSuite) ConfigureTransferChannel()

func (*IBCConnectionTestSuite) FundAcc

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

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

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