Skip to content

Commit

Permalink
fix(compat): fix localhost failing on invalid version being passed. (#…
Browse files Browse the repository at this point in the history
…6875)

* fix(compat): fix localhost failing on invalid version being passed.

* chore(compat): remove test name from compat matrix.
  • Loading branch information
DimitrisJim authored Jul 18, 2024
1 parent 17e3b91 commit 930842a
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestRecoverClient_Succeeds",
"TestScheduleIBCUpgrade_Succeeds",
"TestClient_Update_Misbehaviour",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestRecoverClient_Succeeds",
"TestScheduleIBCUpgrade_Succeeds",
"TestClient_Update_Misbehaviour",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestRecoverClient_Succeeds",
"TestScheduleIBCUpgrade_Succeeds",
"TestClient_Update_Misbehaviour",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"TestClientTestSuite"
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
],
Expand Down
3 changes: 2 additions & 1 deletion e2e/tests/transfer/localhost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"testing"

"github.com/strangelove-ventures/interchaintest/v8/ibc"
test "github.com/strangelove-ventures/interchaintest/v8/testutil"
testifysuite "github.com/stretchr/testify/suite"

Expand Down Expand Up @@ -37,7 +38,7 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() {

chainA, _ := s.GetChains()

channelVersion := transfertypes.V2
channelVersion := testsuite.DetermineDefaultTransferVersion([]ibc.Chain{chainA})

chainADenom := chainA.Config().Denom

Expand Down
10 changes: 5 additions & 5 deletions e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,15 +670,15 @@ func (s *E2ETestSuite) GetRelayerExecReporter() *testreporter.RelayerExecReporte
// TransferChannelOptions configures both of the chains to have non-incentivized transfer channels.
func (s *E2ETestSuite) TransferChannelOptions() ibc.CreateChannelOptions {
opts := ibc.DefaultChannelOpts()
opts.Version = determineDefaultTransferVersion(s.GetAllChains())
opts.Version = DetermineDefaultTransferVersion(s.GetAllChains())
return opts
}

// FeeTransferChannelOptions configures both of the chains to have fee middleware enabled.
func (s *E2ETestSuite) FeeTransferChannelOptions() ibc.CreateChannelOptions {
versionMetadata := feetypes.Metadata{
FeeVersion: feetypes.Version,
AppVersion: determineDefaultTransferVersion(s.GetAllChains()),
AppVersion: DetermineDefaultTransferVersion(s.GetAllChains()),
}
versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata)
s.Require().NoError(err)
Expand Down Expand Up @@ -797,13 +797,13 @@ func ThreeChainSetup() ChainOptionConfiguration {
// DefaultChannelOpts returns the default chain options for the test suite based on the provided chains.
func DefaultChannelOpts(chains []ibc.Chain) ibc.CreateChannelOptions {
channelOptions := ibc.DefaultChannelOpts()
channelOptions.Version = determineDefaultTransferVersion(chains)
channelOptions.Version = DetermineDefaultTransferVersion(chains)
return channelOptions
}

// determineDefaultTransferVersion determines the version of transfer that should be used with an arbitrary number of chains.
// DetermineDefaultTransferVersion determines the version of transfer that should be used with an arbitrary number of chains.
// the default is V2, but if any chain does not support V2, then V1 is used.
func determineDefaultTransferVersion(chains []ibc.Chain) string {
func DetermineDefaultTransferVersion(chains []ibc.Chain) string {
for _, chain := range chains {
chainVersion := chain.Config().Images[0].Version
if !testvalues.ICS20v2FeatureReleases.IsSupported(chainVersion) {
Expand Down

0 comments on commit 930842a

Please sign in to comment.