integration

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSidecarToNode

func AddSidecarToNode(node *cosmos.ChainNode, conf ibc.SidecarConfig)

AddSidecarToNode adds the sidecar configured by the given config to the given node. These are configured so that the sidecar is started before the node is started.

func CCVChainConstructor

func CCVChainConstructor(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos.CosmosChain

CCVChainConstructor is a constructor for the CCV chain

func CreateTx

func CreateTx(t *testing.T, chain *cosmos.CosmosChain, user cosmos.User, GasPrice int64, msgs ...sdk.Msg) []byte

CreateTx creates a new transaction to be signed by the given user, including a provided set of messages

func DefaultChainConstructor

func DefaultChainConstructor(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos.CosmosChain

DefaultChainConstructor is the default construct of a chan that will be used in the slinky integration tests. There is only a single chain that is created.

func DefaultMarketMap

func DefaultMarketMap() mmtypes.MarketMap

func DefaultOracleConfig

func DefaultOracleConfig(url string) oracleconfig.OracleConfig

func DefaultOracleSidecar

func DefaultOracleSidecar(image ibc.DockerImage) ibc.SidecarConfig

func ExpectVoteExtensions

func ExpectVoteExtensions(chain *cosmos.CosmosChain, timeout time.Duration, ves []slinkyabci.OracleVoteExtension) (uint64, error)

ExpectVoteExtensions waits for empty oracle update waits for a pre-determined number of blocks for an extended commit with the given oracle-vote extensions provided per validator. This method returns the height at which the condition was satisfied.

Notice: the height returned is safe for querying, i.e the prices will have been written to state if a quorum reported

func GetChainGRPC

func GetChainGRPC(chain *cosmos.CosmosChain) (cc *grpc.ClientConn, close func(), err error)

GetChainGRPC gets a GRPC client of the given chain

NOTICE: this client must be closed after use

func GetOracleSideCar

func GetOracleSideCar(node *cosmos.ChainNode) *cosmos.SidecarProcess

func PassProposal

func PassProposal(chain *cosmos.CosmosChain, propId string, timeout time.Duration) error

PassProposal given a proposal id, vote for the proposal and wait for it to pass

func QueryCurrencyPair

func QueryCurrencyPair(chain *cosmos.CosmosChain, cp slinkytypes.CurrencyPair, height uint64) (*oracletypes.QuotePrice, int64, error)

QueryCurrencyPair queries the price for the given currency-pair given a desired height to query from

func QueryCurrencyPairMappings

func QueryCurrencyPairMappings(chain *cosmos.CosmosChain) (*oracletypes.GetCurrencyPairMappingResponse, error)

QueryCurrencyPairMappings queries the chain for the given currency pair mappings

func QueryCurrencyPairs

func QueryCurrencyPairs(chain *cosmos.CosmosChain) (*oracletypes.GetAllCurrencyPairsResponse, error)

QueryCurrencyPairs queries the chain for the given CurrencyPair, this method returns the grpc response from the module

func QueryMarket

func QueryMarket(chain *cosmos.CosmosChain, cp slinkytypes.CurrencyPair) (mmtypes.Market, error)

QueryMarket queries a market from the market map.

func QueryMarketMap

func QueryMarketMap(chain *cosmos.CosmosChain) (*mmtypes.MarketMapResponse, error)

QueryMarketMap queries the market map. This query util provides an additional query to the list endpoint and ensures that the response data in both queries is equal.

func QueryMarkets

func QueryMarkets(chain *cosmos.CosmosChain) (*mmtypes.MarketsResponse, error)

QueryMarkets queries all markets .

func QueryProposal

func QueryProposal(chain *cosmos.CosmosChain, propID string) (*govtypesv1.QueryProposalResponse, error)

QueryProposal queries the chain for a given proposal

func RestartOracle

func RestartOracle(node *cosmos.ChainNode) error

RestartOracle restarts the oracle sidecar for a given node

func SetOracleConfigsOnApp

func SetOracleConfigsOnApp(node *cosmos.ChainNode)

SetOracleConfigsOnApp writes the oracle configuration to the given node's application config.

func SetOracleConfigsOnOracle

func SetOracleConfigsOnOracle(
	oracle *cosmos.SidecarProcess,
	oracleCfg oracleconfig.OracleConfig,
)

SetOracleConfigsOnOracle writes the oracle and metrics configs to the given node's oracle sidecar.

func StartOracle

func StartOracle(node *cosmos.ChainNode) error

StartOracle starts the oracle sidecar for a given node

func StopOracle

func StopOracle(node *cosmos.ChainNode) error

StopOracle stops the oracle sidecar for a given node

func SubmitProposal

func SubmitProposal(chain *cosmos.CosmosChain, deposit sdk.Coin, submitter string, msgs ...sdk.Msg) (string, error)

SubmitProposal creates and submits a proposal to the chain

func WaitForHeight

func WaitForHeight(chain *cosmos.CosmosChain, height uint64, timeout time.Duration) error

WaitForHeight waits for the giuve height to be reached

func WaitForProposalStatus

func WaitForProposalStatus(chain *cosmos.CosmosChain, propID string, timeout time.Duration, status govtypesv1.ProposalStatus) error

WaitForProposalStatus waits for the deposit period for the proposal to end

Types

type CCVInterchain

type CCVInterchain struct {
	// contains filtered or unexported fields
}

func (*CCVInterchain) IBCPath

func (c *CCVInterchain) IBCPath() string

func (*CCVInterchain) Relayer

func (c *CCVInterchain) Relayer() ibc.Relayer

func (*CCVInterchain) Reporter

type ChainConstructor

type ChainConstructor func(t *testing.T, spec *interchaintest.ChainSpec) []*cosmos.CosmosChain

ChainConstructor returns the chain that will be using slinky, as well as any additional chains that are needed for the test. The first chain returned will be the chain that is used in the slinky integration tests.

type Interchain

type Interchain interface {
	Relayer() ibc.Relayer
	Reporter() *testreporter.RelayerExecReporter
	IBCPath() string
}

Interchain is an interface representing the set of chains that are used in the slinky e2e tests, as well as any additional relayer / ibc-path information

func CCVInterchainConstructor

func CCVInterchainConstructor(ctx context.Context, t *testing.T, chains []*cosmos.CosmosChain) Interchain

CCVInterchainConstructor is a constructor for the CCV interchain

func DefaultInterchainConstructor

func DefaultInterchainConstructor(ctx context.Context, t *testing.T, chains []*cosmos.CosmosChain) Interchain

DefaultInterchainConstructor is the default constructor of an interchain that will be used in the slinky.

type InterchainConstructor

type InterchainConstructor func(ctx context.Context, t *testing.T, chains []*cosmos.CosmosChain) Interchain

InterchainConstructor returns an interchain that will be used in the slinky integration tests. The chains used in the interchain constructor should be the chains constructed via the ChainConstructor

type Option

type Option func(*SlinkyIntegrationSuite)

Option is a function that modifies the SlinkyIntegrationSuite

func WithAuthority

func WithAuthority(addr sdk.AccAddress) Option

WithAuthority sets the authority address

func WithBlockTime

func WithBlockTime(t time.Duration) Option

WithBlockTime sets the block time

func WithChainConstructor

func WithChainConstructor(cc ChainConstructor) Option

WithChainConstructor sets the chain constructor

func WithDenom

func WithDenom(denom string) Option

WithDenom sets the token denom

func WithInterchainConstructor

func WithInterchainConstructor(ic InterchainConstructor) Option

WithInterchainConstructor sets the interchain constructor

type PrivValFile

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

type SlinkyCCVSuite

type SlinkyCCVSuite struct {
	*SlinkyIntegrationSuite
}

SlinkyCCVSuite is a testing-suite for testing slinky's integration with ics consumer chains

func NewSlinkyCCVIntegrationSuite

func NewSlinkyCCVIntegrationSuite(
	spec *interchaintest.ChainSpec, oracleImage ibc.DockerImage, opts ...Option,
) *SlinkyCCVSuite

func (*SlinkyCCVSuite) TestCCVAggregation

func (s *SlinkyCCVSuite) TestCCVAggregation()

type SlinkyIntegrationSuite

type SlinkyIntegrationSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

func NewSlinkyIntegrationSuite

func NewSlinkyIntegrationSuite(spec *interchaintest.ChainSpec, oracleImage ibc.DockerImage, opts ...Option) *SlinkyIntegrationSuite

func (*SlinkyIntegrationSuite) AddCurrencyPairs

func (s *SlinkyIntegrationSuite) AddCurrencyPairs(chain *cosmos.CosmosChain, user cosmos.User, price float64,
	tickers ...mmtypes.Ticker,
) error

AddCurrencyPairs creates + submits the proposal to add the given currency-pairs to state, votes for the prop w/ all nodes, and waits for the proposal to pass.

func (*SlinkyIntegrationSuite) RemoveMarket

func (s *SlinkyIntegrationSuite) RemoveMarket(
	chain *cosmos.CosmosChain,
	markets []slinkytypes.CurrencyPair,
) error

func (*SlinkyIntegrationSuite) SetupSuite

func (s *SlinkyIntegrationSuite) SetupSuite()

func (*SlinkyIntegrationSuite) SetupTest

func (s *SlinkyIntegrationSuite) SetupTest()

func (*SlinkyIntegrationSuite) TearDownSuite

func (s *SlinkyIntegrationSuite) TearDownSuite()

func (*SlinkyIntegrationSuite) Teardown

func (s *SlinkyIntegrationSuite) Teardown()

func (*SlinkyIntegrationSuite) TestMultiplePriceFeeds

func (s *SlinkyIntegrationSuite) TestMultiplePriceFeeds()

func (*SlinkyIntegrationSuite) UpdateCurrencyPair

func (s *SlinkyIntegrationSuite) UpdateCurrencyPair(chain *cosmos.CosmosChain, markets []mmtypes.Market) error

type SlinkyOracleIntegrationSuite

type SlinkyOracleIntegrationSuite struct {
	*SlinkyIntegrationSuite
}

func NewSlinkyOracleIntegrationSuite

func NewSlinkyOracleIntegrationSuite(suite *SlinkyIntegrationSuite) *SlinkyOracleIntegrationSuite

func (*SlinkyOracleIntegrationSuite) TestNodeFailures

func (s *SlinkyOracleIntegrationSuite) TestNodeFailures()

func (*SlinkyOracleIntegrationSuite) TestOracleModule

func (s *SlinkyOracleIntegrationSuite) TestOracleModule()

type SlinkyOracleValidatorIntegrationSuite

type SlinkyOracleValidatorIntegrationSuite struct {
	*SlinkyIntegrationSuite
}

func (*SlinkyOracleValidatorIntegrationSuite) TestUnbonding

func (s *SlinkyOracleValidatorIntegrationSuite) TestUnbonding()

Jump to

Keyboard shortcuts

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