Skip to content

Commit

Permalink
chore: assert relayer channels
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Apr 18, 2024
1 parent 9717fff commit 009cfc0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/interchain/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ replace (

// These replace statements were inspired by celestia-app.
replace (
github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v1.20.2-sdk-v0.46.16
github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v1.21.0-sdk-v0.46.16
github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4
github.com/docker/docker => github.com/docker/docker v24.0.1+incompatible
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand Down
4 changes: 2 additions & 2 deletions test/interchain/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pY
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o=
github.com/celestiaorg/celestia-core v1.35.0-tm-v0.34.29 h1:sXERzNXgyHyqTKNQx4S29C/NMDzgav62DaQDNF49HUQ=
github.com/celestiaorg/celestia-core v1.35.0-tm-v0.34.29/go.mod h1:weZR4wYx1Vcw3g1Jc5G8VipG4M+KUDSqeIzyyWszmsQ=
github.com/celestiaorg/cosmos-sdk v1.20.2-sdk-v0.46.16 h1:EmzwDx64oG8eKZPar50VCkpzxDNqjjtt7rOBJsMQY8E=
github.com/celestiaorg/cosmos-sdk v1.20.2-sdk-v0.46.16/go.mod h1:AmuR63HTlX8vNV3+NGWNPIZa95J1UweTUmWDHSdTGj0=
github.com/celestiaorg/cosmos-sdk v1.21.0-sdk-v0.46.16 h1:P44npoIUuortDf0nQSUpTwO8zsWoHufbDD/doU+CtxY=
github.com/celestiaorg/cosmos-sdk v1.21.0-sdk-v0.46.16/go.mod h1:AmuR63HTlX8vNV3+NGWNPIZa95J1UweTUmWDHSdTGj0=
github.com/celestiaorg/nmt v0.20.0 h1:9i7ultZ8Wv5ytt8ZRaxKQ5KOOMo4A2K2T/aPGjIlSas=
github.com/celestiaorg/nmt v0.20.0/go.mod h1:Oz15Ub6YPez9uJV0heoU4WpFctxazuIhKyUtaYNio7E=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
Expand Down
13 changes: 13 additions & 0 deletions test/interchain/inter_chain_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package interchain
import (
"context"
"fmt"
"strings"
"testing"

"cosmossdk.io/math"
Expand Down Expand Up @@ -103,4 +104,16 @@ func TestInterChainAccounts(t *testing.T) {
require.Empty(t, stderr)
t.Logf("stdout %v\n", string(stdout))
assert.NotEmpty(t, string(stdout))

channels, err := relayer.GetChannels(ctx, reporter, cosmosHub.Config().ChainID)
require.NoError(t, err)
fmt.Printf("cosmosHub channels: %#v\n", channels)
assert.Len(t, channels, 2) // 2 channels: the first is ics27-1, the second is ics20-1.
assert.True(t, strings.HasPrefix(channels[0].PortID, "icacontroller"), "Expected %v to start with %v", channels[0].PortID, "icacontroller")

channels, err = relayer.GetChannels(ctx, reporter, celestia.Config().ChainID)
require.NoError(t, err)
fmt.Printf("celestia channels: %#v\n", channels)
assert.Len(t, channels, 2) // 2 channels: the first is ics27-1, the second is ics20-1.
assert.Equal(t, "icahost", channels[0].PortID)
}

0 comments on commit 009cfc0

Please sign in to comment.