Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test updated ICS consumer versions.
Browse files Browse the repository at this point in the history
fastfadingviolets committed Oct 22, 2024
1 parent acc3788 commit 05dd3df
Showing 10 changed files with 200 additions and 111 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interchain-test.yml
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ jobs:
matrix:
${{fromJson(needs.prepare-matrix.outputs.matrix)}}
fail-fast: false
max-parallel: 10
max-parallel: 3
steps:
- name: Check out repository code
uses: actions/checkout@v4
21 changes: 14 additions & 7 deletions tests/interchain/chainsuite/chain_ics.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ import (
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
"go.uber.org/multierr"
"golang.org/x/mod/semver"

clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ccvclient "github.com/cosmos/interchain-security/v5/x/ccv/provider/client"
@@ -126,11 +125,12 @@ func (p *Chain) AddConsumerChain(ctx context.Context, relayer *Relayer, config C
}
}

if config.Spec == nil {
config.Spec = p.DefaultConsumerChainSpec(ctx, chainID, config, spawnTime, proposalWaiter)
}
if semver.Compare(p.GetNode().ICSVersion(ctx), "v4.1.0") > 0 && config.Spec.InterchainSecurityConfig.ProviderVerOverride == "" {
config.Spec.InterchainSecurityConfig.ProviderVerOverride = "v4.1.0"
defaultSpec := p.DefaultConsumerChainSpec(ctx, chainID, config, spawnTime, proposalWaiter)
config.Spec = MergeChainSpecs(defaultSpec, config.Spec)
providerICS := p.GetNode().ICSVersion(ctx)
if config.Spec.InterchainSecurityConfig.ConsumerVerOverride == "" {
// This will disable the genesis transform
config.Spec.InterchainSecurityConfig.ConsumerVerOverride = providerICS
}
cf := interchaintest.NewBuiltinChainFactory(
GetLogger(ctx),
@@ -576,7 +576,14 @@ func (p *Chain) CheckCCV(ctx context.Context, consumer *Chain, relayer *Relayer,
}
}

tCtx, tCancel := context.WithTimeout(ctx, 5*time.Minute)
if err := relayer.ClearCCVChannel(ctx, p, consumer); err != nil {
return err
}
if err := testutil.WaitForBlocks(ctx, 2, p, consumer); err != nil {
return err
}

tCtx, tCancel := context.WithTimeout(ctx, 15*time.Minute)
defer tCancel()
var retErr error
for tCtx.Err() == nil {
57 changes: 34 additions & 23 deletions tests/interchain/chainsuite/config.go
Original file line number Diff line number Diff line change
@@ -50,33 +50,44 @@ const (
SlashingWindowConsumer = 20
BlocksPerDistribution = 10
StrideVersion = "v22.0.0"
NeutronVersion = "v3.0.2"
TransferPortID = "transfer"
// This is needed because not every ics image is in the default heighliner registry
HyphaICSRepo = "ghcr.io/hyphacoop/ics"
ICSUidGuid = "1025:1025"
)

func (c SuiteConfig) Merge(other SuiteConfig) SuiteConfig {
if c.ChainSpec == nil {
c.ChainSpec = other.ChainSpec
} else if other.ChainSpec != nil {
c.ChainSpec.ChainConfig = c.ChainSpec.MergeChainSpecConfig(other.ChainSpec.ChainConfig)
if other.ChainSpec.Name != "" {
c.ChainSpec.Name = other.ChainSpec.Name
}
if other.ChainSpec.ChainName != "" {
c.ChainSpec.ChainName = other.ChainSpec.ChainName
}
if other.ChainSpec.Version != "" {
c.ChainSpec.Version = other.ChainSpec.Version
}
if other.ChainSpec.NoHostMount != nil {
c.ChainSpec.NoHostMount = other.ChainSpec.NoHostMount
}
if other.ChainSpec.NumValidators != nil {
c.ChainSpec.NumValidators = other.ChainSpec.NumValidators
}
if other.ChainSpec.NumFullNodes != nil {
c.ChainSpec.NumFullNodes = other.ChainSpec.NumFullNodes
}
func MergeChainSpecs(spec, other *interchaintest.ChainSpec) *interchaintest.ChainSpec {
if spec == nil {
return other
}
if other == nil {
return spec
}
spec.ChainConfig = spec.MergeChainSpecConfig(other.ChainConfig)
if other.Name != "" {
spec.Name = other.Name
}
if other.ChainName != "" {
spec.ChainName = other.ChainName
}
if other.Version != "" {
spec.Version = other.Version
}
if other.NoHostMount != nil {
spec.NoHostMount = other.NoHostMount
}
if other.NumValidators != nil {
spec.NumValidators = other.NumValidators
}
if other.NumFullNodes != nil {
spec.NumFullNodes = other.NumFullNodes
}
return spec
}

func (c SuiteConfig) Merge(other SuiteConfig) SuiteConfig {
c.ChainSpec = MergeChainSpecs(c.ChainSpec, other.ChainSpec)
c.UpgradeOnSetup = other.UpgradeOnSetup
c.CreateRelayer = other.CreateRelayer
c.Scope = other.Scope
23 changes: 18 additions & 5 deletions tests/interchain/consensus_test.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ import (
"testing"

"github.com/cosmos/gaia/v21/tests/interchain/chainsuite"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"github.com/tidwall/gjson"
@@ -91,12 +93,23 @@ func (s *ConsensusSuite) SetupSuite() {

cfg := chainsuite.ConsumerConfig{
ChainName: "ics-consumer",
Version: "v5.0.0",
Version: "v6.2.1",
ShouldCopyProviderKey: allProviderKeysCopied(),
Denom: chainsuite.Ucon,
TopN: 100,
AllowInactiveVals: true,
MinStake: 1_000_000,
Spec: &interchaintest.ChainSpec{
ChainConfig: ibc.ChainConfig{
Images: []ibc.DockerImage{
{
Repository: chainsuite.HyphaICSRepo,
Version: "v6.2.1",
UidGid: chainsuite.ICSUidGuid,
},
},
},
},
}
consumer, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg)
s.Require().NoError(err)
@@ -116,7 +129,7 @@ func (s *ConsensusSuite) Test0ValidatorSets() {
s.Require().Equal(s.Chain.ValidatorWallets[i].ValConsAddress, valCons)
}

vals, err = s.Consumer.QueryJSON(s.GetContext(), "validators", "comet-validator-set")
vals, err = s.Consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set")
s.Require().NoError(err)
s.Require().Equal(maxProviderConsensusValidators, len(vals.Array()), vals)
for i := 0; i < maxProviderConsensusValidators; i++ {
@@ -168,7 +181,7 @@ func (s *ConsensusSuite) TestOptInInactive() {
s.Require().NoError(err)
s.Relayer.ClearCCVChannel(s.GetContext(), s.Chain, s.Consumer)
s.Require().EventuallyWithT(func(c *assert.CollectT) {
vals, err := s.Consumer.QueryJSON(s.GetContext(), "validators", "comet-validator-set")
vals, err := s.Consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set")
assert.NoError(c, err)
assert.Equal(c, maxProviderConsensusValidators, len(vals.Array()), vals)
}, 10*chainsuite.CommitTimeout, chainsuite.CommitTimeout)
@@ -178,7 +191,7 @@ func (s *ConsensusSuite) TestOptInInactive() {
}()
s.Require().NoError(s.Relayer.ClearCCVChannel(s.GetContext(), s.Chain, s.Consumer))
s.Require().EventuallyWithT(func(c *assert.CollectT) {
vals, err := s.Consumer.QueryJSON(s.GetContext(), "validators", "comet-validator-set")
vals, err := s.Consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set")
assert.NoError(c, err)
assert.Equal(c, maxProviderConsensusValidators+1, len(vals.Array()), vals)
}, 10*chainsuite.CommitTimeout, chainsuite.CommitTimeout)
@@ -189,7 +202,7 @@ func (s *ConsensusSuite) TestOptInInactive() {
_, err = s.Chain.Validators[5].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[5].Moniker, "provider", "opt-in", consumerID)
s.Require().NoError(err)
s.Require().NoError(s.Relayer.ClearCCVChannel(s.GetContext(), s.Chain, s.Consumer))
vals, err := s.Consumer.QueryJSON(s.GetContext(), "validators", "comet-validator-set")
vals, err := s.Consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set")
s.Require().NoError(err)
s.Require().Equal(maxProviderConsensusValidators+1, len(vals.Array()), vals)
jailed, err = s.Chain.IsValidatorJailedForConsumerDowntime(s.GetContext(), s.Relayer, s.Consumer, 5)
84 changes: 57 additions & 27 deletions tests/interchain/consumer_launch_test.go
Original file line number Diff line number Diff line change
@@ -3,16 +3,20 @@ package interchain_test
import (
"testing"

"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/stretchr/testify/suite"
"golang.org/x/mod/semver"

"github.com/cosmos/gaia/v21/tests/interchain/chainsuite"
)

type ConsumerLaunchSuite struct {
*chainsuite.Suite
OtherChain string
OtherChainVersion string
ShouldCopyProviderKey [chainsuite.ValidatorCount]bool
OtherChain string
OtherChainVersionPreUpgrade string
OtherChainVersionPostUpgrade string
ShouldCopyProviderKey [chainsuite.ValidatorCount]bool
}

func noProviderKeysCopied() [chainsuite.ValidatorCount]bool {
@@ -30,10 +34,21 @@ func someProviderKeysCopied() [chainsuite.ValidatorCount]bool {
func (s *ConsumerLaunchSuite) TestChainLaunch() {
cfg := chainsuite.ConsumerConfig{
ChainName: s.OtherChain,
Version: s.OtherChainVersion,
Version: s.OtherChainVersionPreUpgrade,
ShouldCopyProviderKey: s.ShouldCopyProviderKey,
Denom: chainsuite.Ucon,
TopN: 94,
Spec: &interchaintest.ChainSpec{
ChainConfig: ibc.ChainConfig{
Images: []ibc.DockerImage{
{
Repository: chainsuite.HyphaICSRepo,
Version: s.OtherChainVersionPreUpgrade,
UidGid: chainsuite.ICSUidGuid,
},
},
},
},
}
consumer, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg)
s.Require().NoError(err)
@@ -53,6 +68,8 @@ func (s *ConsumerLaunchSuite) TestChainLaunch() {
s.Require().NoError(err)
s.Require().False(jailed, "validator 5 should not be jailed for downtime")

cfg.Version = s.OtherChainVersionPostUpgrade
cfg.Spec.ChainConfig.Images[0].Version = s.OtherChainVersionPostUpgrade
consumer2, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg)
s.Require().NoError(err)
err = s.Chain.CheckCCV(s.GetContext(), consumer2, s.Relayer, 1_000_000, 0, 1)
@@ -67,42 +84,53 @@ func (s *ConsumerLaunchSuite) TestChainLaunch() {
s.Require().False(jailed, "validator 5 should not be jailed for downtime")
}

func TestICS40ChainLaunch(t *testing.T) {
func selectConsumerVersion(preV21, postV21 string) string {
if semver.Compare(semver.Major(chainsuite.GetEnvironment().OldGaiaImageVersion), "v21") >= 0 {
return postV21
}
return preV21
}

func TestICS4ChainLaunch(t *testing.T) {
s := &ConsumerLaunchSuite{
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersion: "v4.0.0",
ShouldCopyProviderKey: noProviderKeysCopied(),
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersionPreUpgrade: selectConsumerVersion("v4.4.1", "v4.5.0"),
OtherChainVersionPostUpgrade: "v4.5.0",
ShouldCopyProviderKey: noProviderKeysCopied(),
}
suite.Run(t, s)
}

func TestICS33ConsumerAllKeysChainLaunch(t *testing.T) {
func TestICS6ConsumerAllKeysChainLaunch(t *testing.T) {
s := &ConsumerLaunchSuite{
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersion: "v3.3.0",
ShouldCopyProviderKey: allProviderKeysCopied(),
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersionPreUpgrade: selectConsumerVersion("v6.0.0", "v6.2.1"),
OtherChainVersionPostUpgrade: "v6.2.1",
ShouldCopyProviderKey: allProviderKeysCopied(),
}
suite.Run(t, s)
}

func TestICS33ConsumerSomeKeysChainLaunch(t *testing.T) {
func TestICS6ConsumerSomeKeysChainLaunch(t *testing.T) {
s := &ConsumerLaunchSuite{
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersion: "v3.3.0",
ShouldCopyProviderKey: someProviderKeysCopied(),
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersionPreUpgrade: selectConsumerVersion("v6.0.0", "v6.2.1"),
OtherChainVersionPostUpgrade: "v6.2.1",
ShouldCopyProviderKey: someProviderKeysCopied(),
}
suite.Run(t, s)
}

func TestICS33ConsumerNoKeysChainLaunch(t *testing.T) {
func TestICS6ConsumerNoKeysChainLaunch(t *testing.T) {
s := &ConsumerLaunchSuite{
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersion: "v3.3.0",
ShouldCopyProviderKey: noProviderKeysCopied(),
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{CreateRelayer: true}),
OtherChain: "ics-consumer",
OtherChainVersionPreUpgrade: selectConsumerVersion("v6.0.0", "v6.2.1"),
OtherChainVersionPostUpgrade: "v6.2.1",
ShouldCopyProviderKey: noProviderKeysCopied(),
}
suite.Run(t, s)
}
@@ -112,11 +140,13 @@ type MainnetConsumerChainsSuite struct {
}

func (s *MainnetConsumerChainsSuite) TestMainnetConsumerChainsAfterUpgrade() {
const neutronVersion = "v3.0.2"

// We can't do these consumer launches yet because the chains aren't compatible with launching on v21 yet
if semver.Major(s.Env.OldGaiaImageVersion) == s.Env.UpgradeName && s.Env.UpgradeName == "v21" {
s.T().Skip("Skipping Consumer Launch tests when going from v21 -> v21")
}
neutron, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, chainsuite.ConsumerConfig{
ChainName: "neutron",
Version: neutronVersion,
Version: chainsuite.NeutronVersion,
ShouldCopyProviderKey: allProviderKeysCopied(),
Denom: chainsuite.NeutronDenom,
TopN: 95,
6 changes: 6 additions & 0 deletions tests/interchain/lsm_test.go
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import (
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"golang.org/x/mod/semver"
"golang.org/x/sync/errgroup"
)

@@ -455,6 +456,11 @@ func (s *LSMSuite) setupLSMWallets() {

func (s *LSMSuite) SetupSuite() {
s.Suite.SetupSuite()
// This is slightly broken while stride is still in the process of being upgraded, so skip if
// going from v21 -> v21
if semver.Major(s.Env.OldGaiaImageVersion) == s.Env.UpgradeName && s.Env.UpgradeName == "v21" {
s.T().Skip("Skipping LSM when going from v21 -> v21")
}
stride, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, chainsuite.ConsumerConfig{
ChainName: "stride",
Version: chainsuite.StrideVersion,
4 changes: 4 additions & 0 deletions tests/interchain/matrix_tool/main.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import (
"context"
"encoding/json"
"fmt"
"math/rand/v2"
"os"
"os/exec"
"path"
@@ -105,6 +106,9 @@ func GetTestList() ([]string, error) {
retval = append(retval, line)
}
}
rand.Shuffle(len(retval), func(i, j int) {
retval[i], retval[j] = retval[j], retval[i]
})
return retval, nil
}

85 changes: 48 additions & 37 deletions tests/interchain/permissionless_test.go
Original file line number Diff line number Diff line change
@@ -355,7 +355,7 @@ func (s *PermissionlessConsumersSuite) TestChangePowerShaping() {

s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer, s.Relayer, 1_000_000, 0, 1))

vals, err := consumer.QueryJSON(s.GetContext(), "validators", "comet-validator-set")
vals, err := consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set")
s.Require().NoError(err)
s.Require().Equal(newValidatorCount, len(vals.Array()), vals)
for i := 0; i < newValidatorCount; i++ {
@@ -389,7 +389,6 @@ func (s *PermissionlessConsumersSuite) TestConsumerCommissionRate() {
cfg.Spec = s.Chain.DefaultConsumerChainSpec(s.GetContext(), chainID, cfg, spawnTime, nil)
cfg.Spec.Version = "v4.5.0"
cfg.Spec.Images = images
cfg.Spec.InterchainSecurityConfig.ConsumerVerOverride = "v4.1.0"
consumer1, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg)
s.Require().NoError(err)
s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer1, s.Relayer, 1_000_000, 0, 1))
@@ -399,7 +398,6 @@ func (s *PermissionlessConsumersSuite) TestConsumerCommissionRate() {
cfg.Spec = s.Chain.DefaultConsumerChainSpec(s.GetContext(), chainID, cfg, spawnTime, nil)
cfg.Spec.Version = "v4.5.0"
cfg.Spec.Images = images
cfg.Spec.InterchainSecurityConfig.ConsumerVerOverride = "v4.1.0"
consumer2, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg)
s.Require().NoError(err)
s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer2, s.Relayer, 1_000_000, 0, 1))
@@ -607,8 +605,10 @@ func (s *PermissionlessConsumersSuite) TestRewardsWithChangeover() {
cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.amount", strconv.Itoa(chainsuite.GovMinDepositAmount)),
}
spec := &interchaintest.ChainSpec{
Name: "ics-consumer",
ChainName: "ics-consumer",
Name: "ics-consumer",
ChainName: "ics-consumer",
// Unfortunately, this rc is a bit of a bespoke version; it corresponds to an rc
// in hypha's fork that has a fix for sovereign -> consumer changeovers
Version: "v6.2.0-rc1",
NumValidators: &validators,
NumFullNodes: &fullNodes,
@@ -625,9 +625,9 @@ func (s *PermissionlessConsumersSuite) TestRewardsWithChangeover() {
Bin: "interchain-security-sd",
Images: []ibc.DockerImage{
{
Repository: "ghcr.io/hyphacoop/ics",
Repository: chainsuite.HyphaICSRepo,
Version: "v6.2.0-rc1",
UidGid: "1025:1025",
UidGid: chainsuite.ICSUidGuid,
},
},
Bech32Prefix: "consumer",
@@ -640,10 +640,10 @@ func (s *PermissionlessConsumersSuite) TestRewardsWithChangeover() {
s.Require().NoError(err)
rewardDenom := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", transferCh.ChannelID, consumer.Config().Denom)).IBCDenom()

s.changeSovereignToConsumer(consumer, transferCh)

s.UpgradeChain()

s.changeSovereignToConsumer(consumer, transferCh)

govAuthority, err := s.Chain.GetGovernanceAddress(s.GetContext())
s.Require().NoError(err)
rewardDenomsProp := providertypes.MsgChangeRewardDenoms{
@@ -676,6 +676,45 @@ func (s *PermissionlessConsumersSuite) TestRewardsWithChangeover() {
s.Require().True(rewards.GT(sdkmath.NewInt(0)), "rewards: %s", rewards.String())
}

func TestPermissionlessConsumers(t *testing.T) {
genesis := chainsuite.DefaultGenesis()
genesis = append(genesis,
cosmos.NewGenesisKV("app_state.gov.params.max_deposit_period", permissionlessDepositPeriod.String()),
)
s := &PermissionlessConsumersSuite{
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{
CreateRelayer: true,
Scope: chainsuite.ChainScopeTest,
ChainSpec: &interchaintest.ChainSpec{
ChainConfig: ibc.ChainConfig{
ModifyGenesis: cosmos.ModifyGenesis(genesis),
},
},
}),
consumerCfg: chainsuite.ConsumerConfig{
ChainName: "ics-consumer",
Version: "v4.5.0",
ShouldCopyProviderKey: allProviderKeysCopied(),
Denom: chainsuite.Ucon,
TopN: 100,
AllowInactiveVals: true,
MinStake: 1_000_000,
Spec: &interchaintest.ChainSpec{
ChainConfig: ibc.ChainConfig{
Images: []ibc.DockerImage{
{
Repository: chainsuite.HyphaICSRepo,
Version: "v4.5.0",
UidGid: chainsuite.ICSUidGuid,
},
},
},
},
},
}
suite.Run(t, s)
}

func (s *PermissionlessConsumersSuite) changeSovereignToConsumer(consumer *chainsuite.Chain, transferCh *ibc.ChannelOutput) {
cfg := s.consumerCfg
cfg.TopN = 0
@@ -771,34 +810,6 @@ func (s *PermissionlessConsumersSuite) changeSovereignToConsumer(consumer *chain
s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer, s.Relayer, 1_000_000, 0, 1))
}

func TestPermissionlessConsumers(t *testing.T) {
genesis := chainsuite.DefaultGenesis()
genesis = append(genesis,
cosmos.NewGenesisKV("app_state.gov.params.max_deposit_period", permissionlessDepositPeriod.String()),
)
s := &PermissionlessConsumersSuite{
Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{
CreateRelayer: true,
Scope: chainsuite.ChainScopeTest,
ChainSpec: &interchaintest.ChainSpec{
ChainConfig: ibc.ChainConfig{
ModifyGenesis: cosmos.ModifyGenesis(genesis),
},
},
}),
consumerCfg: chainsuite.ConsumerConfig{
ChainName: "ics-consumer",
Version: "v5.0.0",
ShouldCopyProviderKey: allProviderKeysCopied(),
Denom: chainsuite.Ucon,
TopN: 100,
AllowInactiveVals: true,
MinStake: 1_000_000,
},
}
suite.Run(t, s)
}

func (s *PermissionlessConsumersSuite) submitChangeRewardDenoms(consumer *chainsuite.Chain) (string, string) {
consumerCh, err := s.Relayer.GetTransferChannel(s.GetContext(), s.Chain, consumer)
s.Require().NoError(err)
16 changes: 6 additions & 10 deletions tests/interchain/pfm_test.go
Original file line number Diff line number Diff line change
@@ -84,11 +84,9 @@ func (s *PFMSuite) TestPFMHappyPath() {
s.Require().EventuallyWithT(func(c *assert.CollectT) {
dEndBalance, err := s.Chains[3].GetBalance(s.GetContext(), dWallet1.Address, targetDenomAD)
assert.NoError(c, err)
balances, err := s.Chains[3].BankQueryAllBalances(s.GetContext(), dWallet1.Address)
assert.NoError(c, err)
assert.Truef(c, dEndBalance.GT(dStartBalance), "expected %d > %d in %s; balances are: %+v",
dEndBalance, dStartBalance, targetDenomAD, balances)
}, 15*chainsuite.CommitTimeout, chainsuite.CommitTimeout, "chain D balance has not increased")
assert.Truef(c, dEndBalance.Sub(dStartBalance).IsPositive(), "expected %d - %d > 0 (it was %d) in %s",
dEndBalance, dStartBalance, dEndBalance.Sub(dStartBalance), targetDenomAD)
}, 30*chainsuite.CommitTimeout, chainsuite.CommitTimeout, "chain D balance has not increased")

aStartBalance, err := s.Chains[0].GetBalance(s.GetContext(), aWallet1.Address, targetDenomDA)
s.Require().NoError(err)
@@ -119,11 +117,9 @@ func (s *PFMSuite) TestPFMHappyPath() {
s.Require().EventuallyWithT(func(c *assert.CollectT) {
aEndBalance, err := s.Chains[0].GetBalance(s.GetContext(), aWallet1.Address, targetDenomDA)
assert.NoError(c, err)
balances, err := s.Chains[0].BankQueryAllBalances(s.GetContext(), aWallet1.Address)
assert.NoError(c, err)
assert.Truef(c, aEndBalance.GT(aStartBalance), "expected %d > %d in %s; balances are: %+v",
aEndBalance, aStartBalance, targetDenomDA, balances)
}, 15*chainsuite.CommitTimeout, chainsuite.CommitTimeout, "chain A balance has not increased")
assert.Truef(c, aEndBalance.Sub(aStartBalance).IsPositive(), "expected %d - %d > 0 (it was %d) in %s",
aEndBalance, aStartBalance, aEndBalance.Sub(aStartBalance), targetDenomDA)
}, 30*chainsuite.CommitTimeout, chainsuite.CommitTimeout, "chain A balance has not increased")

}

13 changes: 12 additions & 1 deletion tests/interchain/unbonding_test.go
Original file line number Diff line number Diff line change
@@ -32,10 +32,21 @@ func (s *UnbondingSuite) SetupSuite() {
s.Suite.SetupSuite()
cfg := chainsuite.ConsumerConfig{
ChainName: "ics-consumer",
Version: "v5.0.0",
Version: selectConsumerVersion("v6.0.0", "v6.2.1"),
ShouldCopyProviderKey: allProviderKeysCopied(),
Denom: chainsuite.Ucon,
TopN: 100,
Spec: &interchaintest.ChainSpec{
ChainConfig: ibc.ChainConfig{
Images: []ibc.DockerImage{
{
Repository: chainsuite.HyphaICSRepo,
Version: selectConsumerVersion("v6.0.0", "v6.2.1"),
UidGid: chainsuite.ICSUidGuid,
},
},
},
},
}
consumer, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg)
s.Require().NoError(err)

0 comments on commit 05dd3df

Please sign in to comment.