Skip to content

Commit

Permalink
chore: Address linter issues in e2e/ (#6115)
Browse files Browse the repository at this point in the history
* Address linter issues in e2e/.

* Update e2e/testsuite/testconfig.go

Co-authored-by: Carlos Rodriguez <[email protected]>

* Use aux variable to print type

---------

Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Cian Hatton <[email protected]>
  • Loading branch information
3 people authored Apr 9, 2024
1 parent 9543cc6 commit c669ce6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
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)
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)
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
6 changes: 5 additions & 1 deletion e2e/testsuite/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c669ce6

Please sign in to comment.