Skip to content

Commit 1da4a1b

Browse files
committed
Push master @jackzampolin: fix issue #238
1 parent 427afec commit 1da4a1b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmd/paths.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
connTypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types"
1010
chanTypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
1111
tmclient "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types"
12+
ibcTypes "github.com/cosmos/cosmos-sdk/x/ibc/types"
1213
"github.com/iqlusioninc/relayer/relayer"
1314
"github.com/spf13/cobra"
1415
"gopkg.in/yaml.v2"
@@ -387,7 +388,7 @@ func pathsListCmd() *cobra.Command {
387388

388389
srcConn, err := ch[src].QueryConnection(srch)
389390
dstConn, _ := ch[dst].QueryConnection(dsth)
390-
if err == nil && srcConn.Connection.State.String() == "OPEN" && dstConn.Connection.State.String() == "OPEN" {
391+
if err == nil && srcConn.Connection.State == ibcTypes.OPEN && dstConn.Connection.State == ibcTypes.OPEN {
391392
connection = "✔"
392393
} else {
393394
printPath(i, k, pth, chains, clients, connection, channel)
@@ -397,7 +398,7 @@ func pathsListCmd() *cobra.Command {
397398

398399
srcChan, err := ch[src].QueryChannel(srch)
399400
dstChan, _ := ch[dst].QueryChannel(dsth)
400-
if err == nil && srcChan.Channel.State.String() == "OPEN" && dstChan.Channel.State.String() == "OPEN" {
401+
if err == nil && srcChan.Channel.State == ibcTypes.OPEN && dstChan.Channel.State == ibcTypes.OPEN {
401402
channel = "✔"
402403
} else {
403404
printPath(i, k, pth, chains, clients, connection, channel)
@@ -490,13 +491,13 @@ func pathsShowCmd() *cobra.Command {
490491

491492
srcConn, err := ch[src].QueryConnection(srch)
492493
dstConn, _ := ch[dst].QueryConnection(dsth)
493-
if err == nil && srcConn.Connection.State.String() == "OPEN" && dstConn.Connection.State.String() == "OPEN" {
494+
if err == nil && srcConn.Connection.State == ibcTypes.OPEN && dstConn.Connection.State == ibcTypes.OPEN {
494495
connection = true
495496
}
496497

497498
srcChan, err := ch[src].QueryChannel(srch)
498499
dstChan, _ := ch[dst].QueryChannel(dsth)
499-
if err == nil && srcChan.Channel.State.String() == "OPEN" && dstChan.Channel.State.String() == "OPEN" {
500+
if err == nil && srcChan.Channel.State == ibcTypes.OPEN && dstChan.Channel.State == ibcTypes.OPEN {
500501
channel = true
501502
}
502503

0 commit comments

Comments
 (0)