Documentation
¶
Index ¶
- func CleanBackupConfig()
- func CreateLogFile(name string) (*os.File, error)
- func DefaultBlockDatabaseFilepath() string
- func DockerSetup(t *testing.T) (*client.Client, string)
- func GetLocalFileContent(fileName string) ([]byte, error)
- func KeepDockerVolumesOnFailure(b bool)
- func New(t *testing.T, cfg Config, logger *zap.Logger, dockerClient *client.Client, ...) ibc.Relayer
- type Config
- type Interchain
- func (ic *Interchain) AddChain(chain chains.Chain, additionalGenesisWallets ...ibc.WalletAmount) *Interchain
- func (ic *Interchain) AddLink(link InterchainLink) *Interchain
- func (ic *Interchain) AddRelayer(relayer ibc.Relayer, name string) *Interchain
- func (ic *Interchain) BuildChains(ctx context.Context, rep *testreporter.RelayerExecReporter, ...) error
- func (ic *Interchain) BuildRelayer(ctx context.Context, rep *testreporter.RelayerExecReporter, ...) error
- func (ic *Interchain) Close() error
- func (ic *Interchain) WithLog(log *zap.Logger) *Interchain
- type InterchainBuildOptions
- type InterchainLink
- type RelayerFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanBackupConfig ¶
func CleanBackupConfig()
func DefaultBlockDatabaseFilepath ¶
func DefaultBlockDatabaseFilepath() string
DefaultBlockDatabaseFilepath is the default filepath to the sqlite database for tracking blocks and transactions.
func DockerSetup ¶
DockerSetup returns a new Docker Client and the ID of a configured network, associated with t.
If any part of the setup fails, t.Fatal is called.
func GetLocalFileContent ¶
func KeepDockerVolumesOnFailure ¶
func KeepDockerVolumesOnFailure(b bool)
KeepDockerVolumesOnFailure sets whether volumes associated with a particular test are retained or deleted following a test failure.
The value is false by default, but can be initialized to true by setting the environment variable IBCTEST_SKIP_FAILURE_CLEANUP to a non-empty value. Alternatively, importers of the interchaintest package may call KeepDockerVolumesOnFailure(true).
Types ¶
type Config ¶
type Config struct { // Tag is the tag used for the relayer image. Tag string `mapstructure:"tag"` // Image is the image that should be used for the relayer. Image string `mapstructure:"image"` // KMS_ID is the kms is that should be used for the relayer. KMS_ID string `mapstructure:"kms_id"` // KMS_URL is the kms endpoint that should be used for the relayer. KMS_URL string `mapstructure:"kms_url"` }
Config holds configuration values for the relayer used in the tests.
type Interchain ¶
type Interchain struct {
// contains filtered or unexported fields
}
Interchain represents a full IBC network, encompassing a collection of one or more chains, one or more relayer instances, and initial account configuration.
func NewInterchain ¶
func NewInterchain() *Interchain
NewInterchain returns a new Interchain.
Typical usage involves multiple calls to AddChain, one or more calls to AddRelayer, one or more calls to AddLink, and then finally a single call to Build.
func (*Interchain) AddChain ¶
func (ic *Interchain) AddChain(chain chains.Chain, additionalGenesisWallets ...ibc.WalletAmount) *Interchain
AddChain adds the given chain to the Interchain, using the chain ID reported by the chain's config. If the given chain already exists, or if another chain with the same configured chain ID exists, AddChain panics.
func (*Interchain) AddLink ¶
func (ic *Interchain) AddLink(link InterchainLink) *Interchain
AddLink adds the given link to the Interchain. If any validation fails, AddLink panics.
func (*Interchain) AddRelayer ¶
func (ic *Interchain) AddRelayer(relayer ibc.Relayer, name string) *Interchain
AddRelayer adds the given relayer with the given name to the Interchain.
func (*Interchain) BuildChains ¶
func (ic *Interchain) BuildChains(ctx context.Context, rep *testreporter.RelayerExecReporter, opts InterchainBuildOptions) error
func (*Interchain) BuildRelayer ¶
func (ic *Interchain) BuildRelayer(ctx context.Context, rep *testreporter.RelayerExecReporter, opts InterchainBuildOptions, kmsId string) error
func (*Interchain) Close ¶
func (ic *Interchain) Close() error
Close cleans up any resources created during Build, and returns any relevant errors.
func (*Interchain) WithLog ¶
func (ic *Interchain) WithLog(log *zap.Logger) *Interchain
WithLog sets the logger on the interchain object. Usually the default nop logger is fine, but sometimes it can be helpful to see more verbose logs, typically by passing zaptest.NewLogger(t).
type InterchainBuildOptions ¶
type InterchainBuildOptions struct { TestName string Client *client.Client NetworkID string // If set, ic.Build does not create paths or links in the relayer, // but it does still configure keys and wallets for declared relayer-chain links. // This is useful for tests that need lower-level access to configuring relayers. SkipPathCreation bool // Optional. Git sha for test invocation. Once Go 1.18 supported, // may be deprecated in favor of runtime/debug.ReadBuildInfo. GitSha string // If set, saves block history to a sqlite3 database to aid debugging. BlockDatabaseFile string }
InterchainBuildOptions describes configuration for (*Interchain).Build.
type InterchainLink ¶
type InterchainLink struct { // Chains involved. Chains []chains.Chain // Relayer to use for link. Relayer ibc.Relayer }
InterchainLink describes a link between two chains, by specifying the chain names, the relayer name, and the name of the path to create.
type RelayerFactory ¶
type RelayerFactory interface { // Build returns a Relayer associated with the given arguments. Build(t *testing.T, cli *client.Client, networkID string) ibc.Relayer // Name returns a descriptive name of the factory, // indicating details of the Relayer that will be built. Name() string // Capabilities is an indication of the features this relayer supports. // Tests for any unsupported features will be skipped rather than failed. Capabilities() map[relayer.Capability]bool }
func NewICONRelayerFactory ¶
func NewICONRelayerFactory(logger *zap.Logger, options ...relayer.RelayerOption) RelayerFactory
Directories
¶
Path | Synopsis |
---|---|
_internal
|
|
blockdb
Package blockdb saves chain and block data for inspection later to aid in debugging ibctest failures.
|
Package blockdb saves chain and block data for inspection later to aid in debugging ibctest failures. |
dockerutil
Package dockerutil contains helpers for interacting with Docker containers.
|
Package dockerutil contains helpers for interacting with Docker containers. |
mocktesting
Package mocktesting contains a mock instance of *testing.T which is useful for testing ibctest's interactions with Go tests.
|
Package mocktesting contains a mock instance of *testing.T which is useful for testing ibctest's interactions with Go tests. |
Package relayer contains general functionality relevant to individual relayer implementations.
|
Package relayer contains general functionality relevant to individual relayer implementations. |
centralized
Package rly provides an interface to the cosmos relayer running in a Docker container.
|
Package rly provides an interface to the cosmos relayer running in a Docker container. |
Package testreporter contains a Reporter for collecting detailed test reports.
|
Package testreporter contains a Reporter for collecting detailed test reports. |
Package testutil includes convenience functions and types to help with testing
|
Package testutil includes convenience functions and types to help with testing |