diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index 06e1f3f3581..fe7ade0ee46 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -101,7 +101,8 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() { s.Require().NoError(err) s.Require().NotEqual(originalChainID, newChainID) - upgradedClientState := clientState.(*ibctm.ClientState) + upgradedClientState, ok := clientState.(*ibctm.ClientState) + s.Require().True(ok) upgradedClientState.ChainId = newChainID scheduleUpgradeMsg, err := clienttypes.NewMsgIBCSoftwareUpgrade( diff --git a/e2e/tests/transfer/localhost_test.go b/e2e/tests/transfer/localhost_test.go index a8909fa9675..e7d5e7299dc 100644 --- a/e2e/tests/transfer/localhost_test.go +++ b/e2e/tests/transfer/localhost_test.go @@ -56,7 +56,8 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() { cs, err := s.QueryClientState(ctx, chainA, exported.LocalhostClientID) s.Require().NoError(err) - localhostClientState := cs.(*localhost.ClientState) + localhostClientState, ok := cs.(*localhost.ClientState) + s.Require().True(ok) originalHeight := localhostClientState.LatestHeight s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA), "failed to wait for blocks") diff --git a/e2e/tests/upgrades/genesis_test.go b/e2e/tests/upgrades/genesis_test.go index 2e2d1850e03..08d913d061e 100644 --- a/e2e/tests/upgrades/genesis_test.go +++ b/e2e/tests/upgrades/genesis_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/strangelove-ventures/interchaintest/v8" - cosmos "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" test "github.com/strangelove-ventures/interchaintest/v8/testutil" "github.com/stretchr/testify/suite" diff --git a/e2e/tests/wasm/grandpa_test.go b/e2e/tests/wasm/grandpa_test.go index b67a4c930e7..4b0824a6103 100644 --- a/e2e/tests/wasm/grandpa_test.go +++ b/e2e/tests/wasm/grandpa_test.go @@ -78,8 +78,11 @@ func (s *GrandpaTestSuite) TestMsgTransfer_Succeeds_GrandpaContract() { chainA, chainB := s.GetGrandpaTestChains() - polkadotChain := chainA.(*polkadot.PolkadotChain) - cosmosChain := chainB.(*cosmos.CosmosChain) + polkadotChain, ok := chainA.(*polkadot.PolkadotChain) + s.Require().True(ok) + + cosmosChain, ok := chainB.(*cosmos.CosmosChain) + s.Require().True(ok) // we explicitly skip path creation as the contract needs to be uploaded before we can create clients. r := s.ConfigureRelayer(ctx, polkadotChain, cosmosChain, nil, func(options *interchaintest.InterchainBuildOptions) { @@ -230,8 +233,11 @@ func (s *GrandpaTestSuite) TestMsgTransfer_TimesOut_GrandpaContract() { chainA, chainB := s.GetGrandpaTestChains() - polkadotChain := chainA.(*polkadot.PolkadotChain) - cosmosChain := chainB.(*cosmos.CosmosChain) + polkadotChain, ok := chainA.(*polkadot.PolkadotChain) + s.Require().True(ok) + + cosmosChain, ok := chainB.(*cosmos.CosmosChain) + s.Require().True(ok) // we explicitly skip path creation as the contract needs to be uploaded before we can create clients. r := s.ConfigureRelayer(ctx, polkadotChain, cosmosChain, nil, func(options *interchaintest.InterchainBuildOptions) { @@ -344,8 +350,11 @@ func (s *GrandpaTestSuite) TestMsgMigrateContract_Success_GrandpaContract() { chainA, chainB := s.GetGrandpaTestChains() - polkadotChain := chainA.(*polkadot.PolkadotChain) - cosmosChain := chainB.(*cosmos.CosmosChain) + polkadotChain, ok := chainA.(*polkadot.PolkadotChain) + s.Require().True(ok) + + cosmosChain, ok := chainB.(*cosmos.CosmosChain) + s.Require().True(ok) // we explicitly skip path creation as the contract needs to be uploaded before we can create clients. r := s.ConfigureRelayer(ctx, polkadotChain, cosmosChain, nil, func(options *interchaintest.InterchainBuildOptions) { @@ -431,8 +440,11 @@ func (s *GrandpaTestSuite) TestMsgMigrateContract_ContractError_GrandpaContract( chainA, chainB := s.GetGrandpaTestChains() - polkadotChain := chainA.(*polkadot.PolkadotChain) - cosmosChain := chainB.(*cosmos.CosmosChain) + polkadotChain, ok := chainA.(*polkadot.PolkadotChain) + s.Require().True(ok) + + cosmosChain, ok := chainB.(*cosmos.CosmosChain) + s.Require().True(ok) // we explicitly skip path creation as the contract needs to be uploaded before we can create clients. r := s.ConfigureRelayer(ctx, polkadotChain, cosmosChain, nil, func(options *interchaintest.InterchainBuildOptions) { @@ -523,8 +535,11 @@ func (s *GrandpaTestSuite) TestRecoverClient_Succeeds_GrandpaContract() { chainA, chainB := s.GetGrandpaTestChains() - polkadotChain := chainA.(*polkadot.PolkadotChain) - cosmosChain := chainB.(*cosmos.CosmosChain) + polkadotChain, ok := chainA.(*polkadot.PolkadotChain) + s.Require().True(ok) + + cosmosChain, ok := chainB.(*cosmos.CosmosChain) + s.Require().True(ok) // we explicitly skip path creation as the contract needs to be uploaded before we can create clients. r := s.ConfigureRelayer(ctx, polkadotChain, cosmosChain, nil, func(options *interchaintest.InterchainBuildOptions) { diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index a8326390750..685e23b27ca 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -740,8 +740,12 @@ func modifyChannelGenesisAppState(ibcAppState []byte) ([]byte, error) { return nil, err } + var channelGenesis map[string]interface{} // be ashamed, be very ashamed - channelGenesis := ibcGenesisMap["channel_genesis"].(map[string]interface{}) + channelGenesis, ok := ibcGenesisMap["channel_genesis"].(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("can't convert IBC genesis map entry into type %T", &channelGenesis) + } delete(channelGenesis, "params") return json.Marshal(ibcGenesisMap)