Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upstream test features + Enable IBCFee for all transfer channels #683

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/upgrades/v15/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ func CreateV15UpgradeHandler(
return nil, err
}

for _, channel := range keepers.IBCKeeper.ChannelKeeper.GetAllChannels(ctx) {
if channel.PortId == "transfer" {
keepers.IBCFeeKeeper.SetFeeEnabled(ctx, channel.PortId, channel.ChannelId)
}
}

return versionMap, err
}
}
12 changes: 7 additions & 5 deletions interchaintest/chain_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"
"time"

"github.com/CosmosContracts/juno/tests/interchaintest/helpers"
"github.com/strangelove-ventures/interchaintest/v7"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
Expand Down Expand Up @@ -36,7 +35,7 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeBran
t.Log(chainName, initialVersion, upgradeBranchVersion, upgradeRepo, upgradeName)

// v45 genesis params
genesisKVs := []helpers.GenesisKV{
genesisKVs := []cosmos.GenesisKV{
{
Key: "app_state.gov.voting_params.voting_period",
Value: VotingPeriod,
Expand All @@ -47,7 +46,7 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeBran
},
{
Key: "app_state.gov.deposit_params.min_deposit.0.denom",
Value: junoConfig.Denom,
Value: Denom,
},
}

Expand All @@ -57,7 +56,7 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeBran
ChainName: chainName,
Version: initialVersion,
ChainConfig: ibc.ChainConfig{
ModifyGenesis: helpers.ModifyGenesis(genesisKVs),
ModifyGenesis: cosmos.ModifyGenesis(genesisKVs),
Images: []ibc.DockerImage{
{
Repository: JunoE2ERepo,
Expand Down Expand Up @@ -115,7 +114,7 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeBran
err = chain.VoteOnProposalAllValidators(ctx, upgradeTx.ProposalID, cosmos.ProposalVoteYes)
require.NoError(t, err, "failed to submit votes")

_, err = cosmos.PollForProposalStatus(ctx, chain, height, height+(haltHeightDelta*2), upgradeTx.ProposalID, cosmos.ProposalStatusPassed)
_, err = cosmos.PollForProposalStatus(ctx, chain, height, height+haltHeightDelta, upgradeTx.ProposalID, cosmos.ProposalStatusPassed)
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*45)
Expand All @@ -134,15 +133,18 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeBran
require.Equal(t, haltHeight, height, "height is not equal to halt height")

// bring down nodes to prepare for upgrade
t.Log("stopping node(s)")
err = chain.StopAllNodes(ctx)
require.NoError(t, err, "error stopping node(s)")

// upgrade version on all nodes
t.Log("upgrading node(s)")
chain.UpgradeVersion(ctx, client, upgradeRepo, upgradeBranchVersion)

// start all nodes back up.
// validators reach consensus on first block after upgrade height
// and chain block production resumes.
t.Log("starting node(s)")
err = chain.StartAllNodes(ctx)
require.NoError(t, err, "error starting upgraded node(s)")

Expand Down
6 changes: 3 additions & 3 deletions interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ replace (
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 //indirect
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// Fixes gas issue, public SubmitProposal
// go get github.com/Reecepbcups/interchaintest/v7@33d7fafb6f8b0207be920659b37dd5ae9c85c0ff
github.com/strangelove-ventures/interchaintest/v7 => github.com/Reecepbcups/interchaintest/v7 v7.0.0-20230512161406-33d7fafb6f8b
// Fixes gas issue, public SubmitProposal, & modify genesis
// go get github.com/Reecepbcups/interchaintest/v7@a01b723ae4e1cd77a8fe114bbc1d6b2cf0136018
github.com/strangelove-ventures/interchaintest/v7 => github.com/Reecepbcups/interchaintest/v7 v7.0.0-20230519210824-a01b723ae4e1
github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7

)
Expand Down
4 changes: 2 additions & 2 deletions interchaintest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2B
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Reecepbcups/interchaintest/v7 v7.0.0-20230512161406-33d7fafb6f8b h1:mTHn72tz8bNXcmf/RClTzhIFuyPbDxdVSXpCeCmCy2Y=
github.com/Reecepbcups/interchaintest/v7 v7.0.0-20230512161406-33d7fafb6f8b/go.mod h1:/FpoaMKTF3OREchZZvg6eGfVYvk7lAwqP9q2TN+lOGs=
github.com/Reecepbcups/interchaintest/v7 v7.0.0-20230519210824-a01b723ae4e1 h1:T2sJ2qnsiCNl3B+tgLSVt3ktieDgAWjsbiMTPC+7ZC0=
github.com/Reecepbcups/interchaintest/v7 v7.0.0-20230519210824-a01b723ae4e1/go.mod h1:/FpoaMKTF3OREchZZvg6eGfVYvk7lAwqP9q2TN+lOGs=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
Expand Down
50 changes: 0 additions & 50 deletions interchaintest/helpers/genesis.go

This file was deleted.

6 changes: 2 additions & 4 deletions interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testreporter"

"github.com/CosmosContracts/juno/tests/interchaintest/helpers"

"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

Expand All @@ -41,7 +39,7 @@ var (
}

// SDK v47 Genesis
defaultGenesisKV = []helpers.GenesisKV{
defaultGenesisKV = []cosmos.GenesisKV{
{
Key: "app_state.gov.params.voting_period",
Value: VotingPeriod,
Expand Down Expand Up @@ -72,7 +70,7 @@ var (
ConfigFileOverrides: nil,
EncodingConfig: junoEncoding(),
UsingNewGenesisCommand: true,
ModifyGenesis: helpers.ModifyGenesis(defaultGenesisKV),
ModifyGenesis: cosmos.ModifyGenesis(defaultGenesisKV),
}

genesisWalletAmount = int64(10_000_000)
Expand Down