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

chore: Address linter issues in e2e/ #6115

Merged
merged 12 commits into from
Apr 9, 2024
3 changes: 2 additions & 1 deletion e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
DimitrisJim marked this conversation as resolved.
Show resolved Hide resolved
upgradedClientState.ChainId = newChainID

scheduleUpgradeMsg, err := clienttypes.NewMsgIBCSoftwareUpgrade(
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 @@ -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)
DimitrisJim marked this conversation as resolved.
Show resolved Hide resolved
originalHeight := localhostClientState.LatestHeight

s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA), "failed to wait for blocks")
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/upgrades/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
35 changes: 25 additions & 10 deletions e2e/tests/wasm/grandpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion e2e/testsuite/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,10 @@ func modifyChannelGenesisAppState(ibcAppState []byte) ([]byte, error) {
}

// 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 ibcGenesisMap entry into map[string]interface{} type")
bznein marked this conversation as resolved.
Show resolved Hide resolved
}
delete(channelGenesis, "params")

return json.Marshal(ibcGenesisMap)
Expand Down
Loading