utils

package
v0.0.0-...-e7bd85c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelDifference

func ChannelDifference(oldChannels, newChannels []ibc.ChannelOutput) (diff []string)

func ClientDifference

func ClientDifference(a, b []*ibc.ClientOutput) (diff []string)

func ConnectionDifference

func ConnectionDifference(a, b []*ibc.ConnectionOutput) (diff []string)

func CreateValidator

func CreateValidator(
	t *testing.T,
	ctx context.Context,
	r ibc.Relayer,
	eRep *testreporter.RelayerExecReporter,
	chain ibc.Chain,
	counterparty ibc.Chain,
)

func GenerateClient

func GenerateClient(
	t *testing.T,
	ctx context.Context,
	testCtx *TestContext,
	r ibc.Relayer,
	eRep *testreporter.RelayerExecReporter,
	path string,
	chainA ibc.Chain,
	chainB ibc.Chain,
) (string, string)

func GenerateConnections

func GenerateConnections(
	t *testing.T,
	ctx context.Context,
	testCtx *TestContext,
	r ibc.Relayer,
	eRep *testreporter.RelayerExecReporter,
	path string,
	chainA ibc.Chain,
	chainB ibc.Chain,
) (string, string)

func GenerateICSChannel

func GenerateICSChannel(
	t *testing.T,
	ctx context.Context,
	r ibc.Relayer,
	eRep *testreporter.RelayerExecReporter,
	icsPath string,
	chainA ibc.Chain,
	chainB ibc.Chain,
)

func GeneratePath

func GeneratePath(
	t *testing.T,
	ctx context.Context,
	r ibc.Relayer,
	eRep *testreporter.RelayerExecReporter,
	chainAId string,
	chainBId string,
	path string,
)

func GetChannelMap

func GetChannelMap(r ibc.Relayer, ctx context.Context, eRep *testreporter.RelayerExecReporter,
	cosmosStride *cosmos.CosmosChain, cosmosNeutron *cosmos.CosmosChain, cosmosAtom *cosmos.CosmosChain) map[string]string

func GetCreateValidatorCmd

func GetCreateValidatorCmd(chain ibc.Chain) []string

func GetDefaultInterchainGenesisMessages

func GetDefaultInterchainGenesisMessages() []string

func GetDefaultNeutronInterchainGenesisMessages

func GetDefaultNeutronInterchainGenesisMessages() []string

func GetPairwiseCCVChannelIds

func GetPairwiseCCVChannelIds(
	testCtx *TestContext,
	achans []ibc.ChannelOutput,
	bchans []ibc.ChannelOutput,
	aToBConnId string,
	bToAConnId string,
	chainA string,
	chainB string,
) (string, string)

returns ccv channel ids

func GetPairwiseConnectionIds

func GetPairwiseConnectionIds(
	aconns ibc.ConnectionOutputs,
	bconns ibc.ConnectionOutputs,
) ([]string, []string, error)

func GetPairwiseTransferChannelIds

func GetPairwiseTransferChannelIds(
	testCtx *TestContext,
	achans []ibc.ChannelOutput,
	bchans []ibc.ChannelOutput,
	aToBConnId string,
	bToAConnId string,
	chainA string,
	chainB string,
) (string, string)

returns transfer channel ids

func LinkPath

func LinkPath(
	t *testing.T,
	ctx context.Context,
	r ibc.Relayer,
	eRep *testreporter.RelayerExecReporter,
	chainA ibc.Chain,
	chainB ibc.Chain,
	path string,
)

func PrintChannels

func PrintChannels(channels []ibc.ChannelOutput, chain string)

func PrintConnections

func PrintConnections(connections ibc.ConnectionOutputs)

func SetupGaiaGenesis

func SetupGaiaGenesis(allowed_messages []string) func(ibc.ChainConfig, []byte) ([]byte, error)

Sets custom fields for the Gaia genesis file that interchaintest isn't aware of by default.

allowed_messages - explicitly allowed messages to be accepted by the the interchainaccounts section

func SetupNeutronGenesis

func SetupNeutronGenesis(
	soft_opt_out_threshold string,
	reward_denoms []string,
	provider_reward_denoms []string,
	allowed_messages []string) func(ibc.ChainConfig, []byte) ([]byte, error)

Sets custom fields for the Neutron genesis file that interchaintest isn't aware of by default.

soft_opt_out_threshold - the bottom `soft_opt_out_threshold` percentage of validators may opt out of running a Neutron node ^1.

reward_denoms - the reward denominations allowed to be sent to the provider (atom) from the consumer (neutron) ^2.

provider_reward_denoms - the reward denominations allowed to be sent to the consumer by the provider ^2.

func SetupOsmoGenesis

func SetupOsmoGenesis(allowed_messages []string) func(ibc.ChainConfig, []byte) ([]byte, error)

func SetupStrideGenesis

func SetupStrideGenesis(allowed_messages []string) func(ibc.ChainConfig, []byte) ([]byte, error)

Types

type AllAccounts

type AllAccounts struct {
}

type AllAccountsResponse

type AllAccountsResponse struct {
	Data []string `json:"all_accounts_response"`
}

type AssetInfo

type AssetInfo struct {
	Token       *Token       `json:"token,omitempty"`
	NativeToken *NativeToken `json:"native_token,omitempty"`
}

type AstroportAsset

type AstroportAsset struct {
	Info   AssetInfo `json:"info"`
	Amount string    `json:"amount"`
}

type Balance

type Balance struct {
	Address string `json:"address"`
}

type BalanceResponse

type BalanceResponse struct {
	Balance string `json:"balance"`
}

type Callback

type Callback struct {
	Success []string `json:"success,omitempty"`
	Error   string   `json:"error,omitempty"`
}

type CallbackMessage

type CallbackMessage struct {
	Initiator    string   `json:"initiator"`
	InitiatorMsg string   `json:"initiator_msg"`
	Result       Callback `json:"result"`
}

type CallbackRequest

type CallbackRequest struct {
	Receiver string `json:"receiver"`
	Msg      string `json:"msg"`
}

type ClockAddress

type ClockAddress struct{}

type ClockAddressQuery

type ClockAddressQuery struct {
	ClockAddress ClockAddress `json:"clock_address"`
}

type CovenantAddressQueryResponse

type CovenantAddressQueryResponse struct {
	Data string `json:"data"`
}

type CreatePair

type CreatePair struct {
	PairType   PairType    `json:"pair_type"`
	AssetInfos []AssetInfo `json:"asset_infos"`
	InitParams []byte      `json:"init_params"`
}

type CreatePairMsg

type CreatePairMsg struct {
	CreatePair CreatePair `json:"create_pair"`
}

type Cw20BalanceResponse

type Cw20BalanceResponse struct {
	Data BalanceResponse `json:"data"`
}

type Cw20QueryMsg

type Cw20QueryMsg struct {
	Balance Balance `json:"balance"`
}

type CwCoin

type CwCoin struct {
	Denom  string `json:"denom"`
	Amount uint64 `json:"amount"`
}

type FactoryInstantiateMsg

type FactoryInstantiateMsg struct {
	PairConfigs         []PairConfig `json:"pair_configs"`
	TokenCodeId         uint64       `json:"token_code_id"`
	FeeAddress          *string      `json:"fee_address"`
	GeneratorAddress    *string      `json:"generator_address"`
	Owner               string       `json:"owner"`
	WhitelistCodeId     uint64       `json:"whitelist_code_id"`
	CoinRegistryAddress string       `json:"coin_registry_address"`
}

astroport factory

type FactoryPairResponse

type FactoryPairResponse struct {
	Data PairInfo `json:"data"`
}

type HolderAddress

type HolderAddress struct{}

type HolderAddressQuery

type HolderAddressQuery struct {
	HolderAddress HolderAddress `json:"holder_address"`
}

type IbcForwarderQuery

type IbcForwarderQuery struct {
	Party Party `json:"ibc_forwarder_address"`
}

type InterchainRouterQuery

type InterchainRouterQuery struct {
	Party Party `json:"interchain_router_address"`
}

type LPPositionQuery

type LPPositionQuery struct {
	LpPosition LpPositionQuery `json:"lp_position"`
}

type LiquidPoolerAddress

type LiquidPoolerAddress struct{}

type LiquidPoolerQuery

type LiquidPoolerQuery struct {
	LiquidPoolerAddress LiquidPoolerAddress `json:"liquid_pooler_address"`
}

type LpPositionQuery

type LpPositionQuery struct{}

type LpPositionQueryResponse

type LpPositionQueryResponse struct {
	Data string `json:"data"`
}

type NativeBalQueryResponse

type NativeBalQueryResponse struct {
	Amount string `json:"amount"`
	Denom  string `json:"denom"`
}

type NativeToken

type NativeToken struct {
	Denom string `json:"denom"`
}

type NoteInstantiate

type NoteInstantiate struct {
	Pair        *PolytonePair `json:"pair,omitempty"`
	BlockMaxGas string        `json:"block_max_gas,omitempty"`
}

type Pair

type Pair struct {
	AssetInfos []AssetInfo `json:"asset_infos"`
}

type PairConfig

type PairConfig struct {
	CodeId              uint64   `json:"code_id"`
	PairType            PairType `json:"pair_type"`
	TotalFeeBps         uint64   `json:"total_fee_bps"`
	MakerFeeBps         uint64   `json:"maker_fee_bps"`
	IsDisabled          bool     `json:"is_disabled"`
	IsGeneratorDisabled bool     `json:"is_generator_disabled"`
}

type PairInfo

type PairInfo struct {
	LiquidityToken string      `json:"liquidity_token"`
	ContractAddr   string      `json:"contract_addr"`
	PairType       PairType    `json:"pair_type"`
	AssetInfos     []AssetInfo `json:"asset_infos"`
}

type PairQuery

type PairQuery struct {
	Pair Pair `json:"pair"`
}

type PairType

type PairType struct {
	// Xyk    struct{} `json:"xyk,omitempty"`
	Stable struct{} `json:"stable,omitempty"`
}

type Party

type Party struct {
	Party string `json:"party"`
}

type PolytonePair

type PolytonePair struct {
	ConnectionId string `json:"connection_id"`
	RemotePort   string `json:"remote_port"`
}

polytone types

type ProvideLiqudityMsg

type ProvideLiqudityMsg struct {
	ProvideLiquidity ProvideLiquidityStruct `json:"provide_liquidity"`
}

type ProvideLiquidityStruct

type ProvideLiquidityStruct struct {
	Assets            []AstroportAsset `json:"assets"`
	SlippageTolerance string           `json:"slippage_tolerance"`
	AutoStake         bool             `json:"auto_stake"`
	Receiver          string           `json:"receiver"`
}

type SplitterAddress

type SplitterAddress struct{}

type SplitterAddressQuery

type SplitterAddressQuery struct {
	SplitterAddress SplitterAddress `json:"splitter_address"`
}

type StablePoolParams

type StablePoolParams struct {
	Amp   uint64  `json:"amp"`
	Owner *string `json:"owner"`
}

type TestContext

type TestContext struct {
	Neutron *cosmos.CosmosChain
	Hub     *cosmos.CosmosChain
	Osmosis *cosmos.CosmosChain
	Stride  *cosmos.CosmosChain

	OsmoClients    []*ibc.ClientOutput
	GaiaClients    []*ibc.ClientOutput
	NeutronClients []*ibc.ClientOutput
	StrideClients  []*ibc.ClientOutput

	OsmoConnections    []*ibc.ConnectionOutput
	GaiaConnections    []*ibc.ConnectionOutput
	NeutronConnections []*ibc.ConnectionOutput
	StrideConnections  []*ibc.ConnectionOutput

	NeutronTransferChannelIds map[string]string
	GaiaTransferChannelIds    map[string]string
	OsmoTransferChannelIds    map[string]string
	StrideTransferChannelIds  map[string]string

	GaiaIcsChannelIds    map[string]string
	NeutronIcsChannelIds map[string]string
	T                    *testing.T
	Ctx                  context.Context
}

func (*TestContext) CreateAstroportFactoryPair

func (testCtx *TestContext) CreateAstroportFactoryPair(amp uint64, denom1 string, denom2 string, factory string, from *ibc.Wallet, keyring string)

func (*TestContext) CreateAstroportFactoryPairStride

func (testCtx *TestContext) CreateAstroportFactoryPairStride(amp uint64, denom1 string, denom2 string, factory string, from *ibc.Wallet, keyring string)

func (*TestContext) FundChainAddrs

func (testCtx *TestContext) FundChainAddrs(addrs []string, chain *cosmos.CosmosChain, from *ibc.Wallet, amount int64)

func (*TestContext) GetChainClients

func (testCtx *TestContext) GetChainClients(chain string) []*ibc.ClientOutput

func (*TestContext) GetChainConnections

func (testCtx *TestContext) GetChainConnections(chain string) []*ibc.ConnectionOutput

func (*TestContext) GetIbcDenom

func (testCtx *TestContext) GetIbcDenom(channelId string, denom string) string

func (*TestContext) GetMultihopIbcDenom

func (testCtx *TestContext) GetMultihopIbcDenom(channelTrace []string, denom string) string

channel trace should be an ordered list of the path denom would take, starting from the source chain, and ending on the destination chain. assumes "transfer" ports.

func (*TestContext) GetNeutronHeight

func (testCtx *TestContext) GetNeutronHeight() uint64

func (*TestContext) GetPermisionlessLsTransferMessage

func (testCtx *TestContext) GetPermisionlessLsTransferMessage(amount uint64, liquidStakerAddress string, user *ibc.Wallet, keyring string) []string

func (*TestContext) HolderClaim

func (testCtx *TestContext) HolderClaim(contract string, from *ibc.Wallet, keyring string)

func (*TestContext) HolderRagequit

func (testCtx *TestContext) HolderRagequit(contract string, from *ibc.Wallet, keyring string)

func (*TestContext) InstantiateAstroportFactory

func (testCtx *TestContext) InstantiateAstroportFactory(pairCodeId uint64, tokenCodeId uint64, whitelistCodeId uint64, factoryCodeId uint64, coinRegistryAddr string, from *ibc.Wallet) string

func (*TestContext) InstantiateCmdExecNeutron

func (testCtx *TestContext) InstantiateCmdExecNeutron(codeId uint64, label string, msg any, from *ibc.Wallet, keyring string) string

func (*TestContext) InstantiateCmdExecOsmo

func (testCtx *TestContext) InstantiateCmdExecOsmo(codeId uint64, label string, msg any, from *ibc.Wallet, keyring string) string

func (*TestContext) InstantiateOsmoOutpost

func (testCtx *TestContext) InstantiateOsmoOutpost(outpostCode uint64, from *ibc.Wallet) string

func (*TestContext) ManualExecNeutron

func (testCtx *TestContext) ManualExecNeutron(contract string, msg any, from *ibc.Wallet, keyring string)

func (*TestContext) ManualInstantiate

func (testCtx *TestContext) ManualInstantiate(codeId uint64, msg any, from *ibc.Wallet, keyring string) string

func (*TestContext) ManualInstantiateLS

func (testCtx *TestContext) ManualInstantiateLS(codeId uint64, msg any, from *ibc.Wallet, keyring string) string

func (*TestContext) ProvideAstroportLiquidity

func (testCtx *TestContext) ProvideAstroportLiquidity(denom1 string, denom2 string, amount1 uint64, amount2 uint64, from *ibc.Wallet, pool string)

func (*TestContext) QueryAstroLpTokenAndStableswapAddress

func (testCtx *TestContext) QueryAstroLpTokenAndStableswapAddress(
	factoryAddress string, denom1 string, denom2 string,
) (string, string)

func (*TestContext) QueryClockAddress

func (testCtx *TestContext) QueryClockAddress(contract string) string

func (*TestContext) QueryContractDepositAddress

func (testCtx *TestContext) QueryContractDepositAddress(contract string) string

func (*TestContext) QueryContractICA

func (testCtx *TestContext) QueryContractICA(contract string) string

func (*TestContext) QueryContractState

func (testCtx *TestContext) QueryContractState(contract string) string

func (*TestContext) QueryDepositAddress

func (testCtx *TestContext) QueryDepositAddress(covenant string, party string) string

func (*TestContext) QueryDepositAddressSingleParty

func (testCtx *TestContext) QueryDepositAddressSingleParty(covenant string) string

func (*TestContext) QueryHolderAddress

func (testCtx *TestContext) QueryHolderAddress(contract string) string

func (*TestContext) QueryHubDenomBalance

func (testCtx *TestContext) QueryHubDenomBalance(denom string, addr string) uint64

func (*TestContext) QueryIbcForwarderAddress

func (testCtx *TestContext) QueryIbcForwarderAddress(contract string, party string) string

func (*TestContext) QueryIbcForwarderTyAddress

func (testCtx *TestContext) QueryIbcForwarderTyAddress(contract string, ty string) string

func (*TestContext) QueryInterchainRouterAddress

func (testCtx *TestContext) QueryInterchainRouterAddress(contract string, party string) string

func (*TestContext) QueryInterchainSplitterAddress

func (testCtx *TestContext) QueryInterchainSplitterAddress(contract string) string

func (*TestContext) QueryLiquidPoolerAddress

func (testCtx *TestContext) QueryLiquidPoolerAddress(contract string) string

func (*TestContext) QueryLiquidStakerAddress

func (testCtx *TestContext) QueryLiquidStakerAddress(contract string) string

func (*TestContext) QueryLpTokenBalance

func (testCtx *TestContext) QueryLpTokenBalance(token string, addr string) uint64

func (*TestContext) QueryNeutronDenomBalance

func (testCtx *TestContext) QueryNeutronDenomBalance(denom string, addr string) uint64

func (*TestContext) QueryOsmoDenomBalance

func (testCtx *TestContext) QueryOsmoDenomBalance(denom string, addr string) uint64

func (*TestContext) QueryProxyAddress

func (testCtx *TestContext) QueryProxyAddress(contract string) string

func (*TestContext) QueryRemoteChainSplitterAddress

func (testCtx *TestContext) QueryRemoteChainSplitterAddress(contract string) string

func (*TestContext) QuerySinglePartyInterchainRouterAddress

func (testCtx *TestContext) QuerySinglePartyInterchainRouterAddress(contract string) string

func (*TestContext) QueryStrideDenomBalance

func (testCtx *TestContext) QueryStrideDenomBalance(denom string, addr string) uint64

func (*TestContext) SetIcsChannelId

func (testCtx *TestContext) SetIcsChannelId(chain string, destChain string, channelId string)

func (*TestContext) SetTransferChannelId

func (testCtx *TestContext) SetTransferChannelId(chain string, destChain string, channelId string)

func (*TestContext) SkipBlocks

func (testCtx *TestContext) SkipBlocks(n uint64)

func (*TestContext) SkipBlocksStride

func (testCtx *TestContext) SkipBlocksStride(n uint64)

func (*TestContext) StoreContract

func (testCtx *TestContext) StoreContract(chain *cosmos.CosmosChain, from *ibc.Wallet, path string) uint64

func (*TestContext) Tick

func (testCtx *TestContext) Tick(clock string, keyring string, from string)

func (*TestContext) TickStride

func (testCtx *TestContext) TickStride(clock string, keyring string, from string)

func (*TestContext) UpdateChainClients

func (testCtx *TestContext) UpdateChainClients(chain string, clients []*ibc.ClientOutput)

func (*TestContext) UpdateChainConnections

func (testCtx *TestContext) UpdateChainConnections(chain string, connections []*ibc.ConnectionOutput)

type Token

type Token struct {
	ContractAddr string `json:"contract_addr"`
}

type VoiceInstantiate

type VoiceInstantiate struct {
	ProxyCodeId uint64 `json:"proxy_code_id,string"`
	BlockMaxGas uint64 `json:"block_max_gas,string"`
}

type WhitelistInstantiateMsg

type WhitelistInstantiateMsg struct {
	Admins  []string `json:"admins"`
	Mutable bool     `json:"mutable"`
}

astroport whitelist

Jump to

Keyboard shortcuts

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