Skip to content

Commit

Permalink
Merge PR #10: Migrate to ibc-go
Browse files Browse the repository at this point in the history
* update go.mod

* changes from old PR & ibc-go migrations doc

* switch to non-deprecated context codec call

* Remove swagger

* Fix build issues

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
  • Loading branch information
jtieri and jackzampolin committed Oct 25, 2021
1 parent c12187b commit adbd637
Show file tree
Hide file tree
Showing 38 changed files with 738 additions and 2,731 deletions.
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,4 @@ delete-chains:
@echo "Removing the ./chain-code/ directory..."
@rm -rf ./chain-code

check-swagger:
which swagger || (GO111MODULE=off go get -u github.com/go-swagger/go-swagger/cmd/swagger)

update-swagger-docs: check-swagger
swagger generate spec -o ./docs/swagger-ui/swagger.yaml

.PHONY: two-chains test install build lint coverage clean
14 changes: 7 additions & 7 deletions cmd/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"os"
"strings"

clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"
conntypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types"
chantypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
tmclient "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types"
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/modules/core/04-channel/types"
"github.com/cosmos/ibc-go/modules/core/exported"
tmclient "github.com/cosmos/ibc-go/modules/light-clients/07-tendermint/types"
"github.com/cosmos/relayer/relayer"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -103,7 +103,7 @@ $ %s pth gen ibc-0 ibc-1 demo-path --unordered false --version ics20-2`, appName
switch cs := clnt.(type) {
case *tmclient.ClientState:
// if the client is an active tendermint client for the counterparty chain then we reuse it
if cs.ChainId == c[dst].ChainID && !cs.IsFrozen() {
if cs.ChainId == c[dst].ChainID && cs.FrozenHeight.IsZero() {
path.Src.ClientID = idCs.ClientId
}
default:
Expand All @@ -121,7 +121,7 @@ $ %s pth gen ibc-0 ibc-1 demo-path --unordered false --version ics20-2`, appName
switch cs := clnt.(type) {
case *tmclient.ClientState:
// if the client is an active tendermint client for the counterparty chain then we reuse it
if cs.ChainId == c[src].ChainID && !cs.IsFrozen() {
if cs.ChainId == c[src].ChainID && cs.FrozenHeight.IsZero() {
path.Dst.ClientID = idCs.ClientId
}
default:
Expand Down
4 changes: 2 additions & 2 deletions cmd/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/x/auth/types"
clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"
tmclient "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types"
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
tmclient "github.com/cosmos/ibc-go/modules/light-clients/07-tendermint/types"
"github.com/cosmos/relayer/helpers"
"github.com/spf13/cobra"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"
commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types"
ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types"
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
commitmenttypes "github.com/cosmos/ibc-go/modules/core/23-commitment/types"
ibctmtypes "github.com/cosmos/ibc-go/modules/light-clients/07-tendermint/types"
"github.com/cosmos/relayer/relayer"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/light"
Expand Down
18 changes: 9 additions & 9 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ func NewRootCmd() *cobra.Command {
Use: appName,
Short: "This application relays data between configured IBC enabled chains",
Long: strings.TrimSpace(`The relayer has commands for:
1. Configuration of the Chains and Paths that the relayer with transfer packets over
2. Management of keys and light clients on the local machine that will be used to sign and verify txs
3. Query and transaction functionality for IBC
4. A responsive relaying application that listens on a path
5. Commands to assist with development, testnets, and versioning.
NOTE: Most of the commands have aliases that make typing them much quicker (i.e. 'rly tx', 'rly q', etc...)`),
1. Configuration of the Chains and Paths that the relayer with transfer packets over
2. Management of keys and light clients on the local machine that will be used to sign and verify txs
3. Query and transaction functionality for IBC
4. A responsive relaying application that listens on a path
5. Commands to assist with development, testnets, and versioning.
NOTE: Most of the commands have aliases that make typing them much quicker (i.e. 'rly tx', 'rly q', etc...)`),
}

rootCmd.PersistentPreRunE = func(cmd *cobra.Command, _ []string) error {
Expand All @@ -71,10 +71,10 @@ NOTE: Most of the commands have aliases that make typing them much quicker (i.e.
rootCmd.PersistentFlags().StringVar(&homePath, flags.FlagHome, defaultHome, "set home directory")
rootCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "debug output")

if err := viper.BindPFlag(flags.FlagHome, rootCmd.Flags().Lookup(flags.FlagHome)); err != nil {
if err := viper.BindPFlag(flags.FlagHome, rootCmd.PersistentFlags().Lookup(flags.FlagHome)); err != nil {
panic(err)
}
if err := viper.BindPFlag("debug", rootCmd.Flags().Lookup("debug")); err != nil {
if err := viper.BindPFlag("debug", rootCmd.PersistentFlags().Lookup("debug")); err != nil {
panic(err)
}

Expand Down
4 changes: 2 additions & 2 deletions dev-env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash -e

RELAYER_DIR="$GOPATH/src/github.com/cosmos/relayer"
RELAYER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
RELAYER_CONF="$HOME/.relayer"
GAIA_CONF="$(pwd)/data"

Expand All @@ -15,6 +14,7 @@ fi

cd $RELAYER_DIR
rm -rf $RELAYER_CONF &> /dev/null
pwd
bash scripts/two-chainz "skip"

echo "waiting for blocks..."
Expand Down
131 changes: 0 additions & 131 deletions docs/game-of-zones/goz-roster.csv

This file was deleted.

Binary file removed docs/images/github-repo-banner.png
Binary file not shown.
Loading

0 comments on commit adbd637

Please sign in to comment.