Skip to content

Commit

Permalink
Update to ibc-go-v8
Browse files Browse the repository at this point in the history
Signed-off-by: Dongri Jin <[email protected]>
  • Loading branch information
dongrie committed Jan 26, 2024
1 parent c226f1b commit 82d246f
Show file tree
Hide file tree
Showing 45 changed files with 1,153 additions and 936 deletions.
6 changes: 3 additions & 3 deletions chains/tendermint/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authTypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/go-bip39"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"

"github.com/hyperledger-labs/yui-relayer/core"
)
Expand Down Expand Up @@ -230,7 +230,7 @@ func (c *Chain) rawSendMsgs(msgs []sdk.Msg) (*sdk.TxResponse, bool, error) {
}

// Attach the signature to the transaction
err = tx.Sign(txf, c.config.Key, txb, false)
err = tx.Sign(context.TODO(), txf, c.config.Key, txb, false)
if err != nil {
return nil, false, err
}
Expand Down
6 changes: 3 additions & 3 deletions chains/tendermint/client-tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"time"

"github.com/cometbft/cometbft/light"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"
tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"
tmclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
)

func createClient(
Expand Down
2 changes: 1 addition & 1 deletion chains/tendermint/cmd/light.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/cosmos/cosmos-sdk/client/flags"
tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
tmclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
"github.com/hyperledger-labs/yui-relayer/chains/tendermint"
"github.com/hyperledger-labs/yui-relayer/config"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion chains/tendermint/light.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
lighthttp "github.com/cometbft/cometbft/light/provider/http"
dbs "github.com/cometbft/cometbft/light/store/db"
tmtypes "github.com/cometbft/cometbft/types"
tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
tmclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
)

// NOTE: currently we are discarding the very noisy light client logs
Expand Down
6 changes: 3 additions & 3 deletions chains/tendermint/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
"github.com/hyperledger-labs/yui-relayer/core"
)

Expand Down
8 changes: 4 additions & 4 deletions chains/tendermint/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/cometbft/cometbft/types"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/codec"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
ibcclient "github.com/cosmos/ibc-go/v7/modules/core/client"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcclient "github.com/cosmos/ibc-go/v8/modules/core/client"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
tmclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"

"github.com/hyperledger-labs/yui-relayer/core"
)
Expand Down
22 changes: 11 additions & 11 deletions chains/tendermint/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (
querytypes "github.com/cosmos/cosmos-sdk/types/query"
bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clientutils "github.com/cosmos/ibc-go/v7/modules/core/02-client/client/utils"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
connutils "github.com/cosmos/ibc-go/v7/modules/core/03-connection/client/utils"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
chanutils "github.com/cosmos/ibc-go/v7/modules/core/04-channel/client/utils"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
committypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clientutils "github.com/cosmos/ibc-go/v8/modules/core/02-client/client/utils"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
connutils "github.com/cosmos/ibc-go/v8/modules/core/03-connection/client/utils"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
chanutils "github.com/cosmos/ibc-go/v8/modules/core/04-channel/client/utils"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
committypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/core"
)

Expand Down Expand Up @@ -121,7 +121,7 @@ func (c *Chain) QueryBalance(ctx core.QueryContext, addr sdk.AccAddress) (sdk.Co
Offset: 0,
Limit: 1000,
CountTotal: true,
})
}, false)

queryClient := bankTypes.NewQueryClient(c.CLIContext(0))

Expand Down Expand Up @@ -414,7 +414,7 @@ func (c *Chain) QueryValsetAtHeight(height clienttypes.Height) (*tmproto.Validat
return protoValSet, err
}

func (c *Chain) toTmValidators(vals stakingtypes.Validators) ([]*tmtypes.Validator, error) {
func (c *Chain) toTmValidators(vals []stakingtypes.Validator) ([]*tmtypes.Validator, error) {
validators := make([]*tmtypes.Validator, len(vals))
var err error
for i, val := range vals {
Expand Down
4 changes: 2 additions & 2 deletions cmd/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/config"
"github.com/hyperledger-labs/yui-relayer/core"
"github.com/hyperledger-labs/yui-relayer/helpers"
Expand Down
4 changes: 2 additions & 2 deletions cmd/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"

"github.com/cosmos/cosmos-sdk/client/flags"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/config"
"github.com/hyperledger-labs/yui-relayer/core"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/xfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
"github.com/hyperledger-labs/yui-relayer/config"
"github.com/hyperledger-labs/yui-relayer/core"
"github.com/spf13/cobra"
Expand Down
10 changes: 5 additions & 5 deletions core/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/log"
)

Expand Down
2 changes: 1 addition & 1 deletion core/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

retry "github.com/avast/retry-go"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
"github.com/hyperledger-labs/yui-relayer/log"
"golang.org/x/exp/slog"
)
Expand Down
4 changes: 2 additions & 2 deletions core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/log"
)

Expand Down
17 changes: 8 additions & 9 deletions core/codec.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package core

import (
"cosmossdk.io/x/evidence"
"cosmossdk.io/x/upgrade"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/capability"
"github.com/cosmos/cosmos-sdk/x/crisis"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/evidence"
"github.com/cosmos/cosmos-sdk/x/genutil"
"github.com/cosmos/cosmos-sdk/x/gov"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
Expand All @@ -20,11 +20,10 @@ import (
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v7/modules/core"
tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
"github.com/cosmos/ibc-go/modules/capability"
transfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v8/modules/core"
tmclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
)

var moduleBasics = module.NewBasicManager(
Expand All @@ -38,8 +37,8 @@ var moduleBasics = module.NewBasicManager(
gov.NewAppModuleBasic(
[]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
//upgradeclient.LegacyProposalHandler,
// upgradeclient.LegacyCancelProposalHandler,
},
),
params.AppModuleBasic{},
Expand Down
6 changes: 3 additions & 3 deletions core/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

retry "github.com/avast/retry-go"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/log"
"golang.org/x/exp/slog"
)
Expand Down
2 changes: 1 addition & 1 deletion core/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/cosmos/ibc-go/v7/modules/core/exported"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
"github.com/hyperledger-labs/yui-relayer/metrics"
"go.opentelemetry.io/otel/attribute"
)
Expand Down
2 changes: 1 addition & 1 deletion core/ics24.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
host "github.com/cosmos/ibc-go/v8/modules/core/24-host"
)

// Vclient validates the client identifier in the path
Expand Down
2 changes: 1 addition & 1 deletion core/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"github.com/cosmos/gogoproto/proto"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
)

// MsgID represents an identifier of `sdk.Msg` that has been sent to a chain by `Chain::SendMsgs`.
Expand Down
4 changes: 2 additions & 2 deletions core/naive-strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

retry "github.com/avast/retry-go"
sdk "github.com/cosmos/cosmos-sdk/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
host "github.com/cosmos/ibc-go/v8/modules/core/24-host"
"github.com/hyperledger-labs/yui-relayer/metrics"
"go.opentelemetry.io/otel/attribute"
api "go.opentelemetry.io/otel/metric"
Expand Down
8 changes: 4 additions & 4 deletions core/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"golang.org/x/sync/errgroup"
"gopkg.in/yaml.v2"

clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
)

const (
Expand Down
14 changes: 7 additions & 7 deletions core/pathEnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"strings"

sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"
)

var (
Expand Down Expand Up @@ -104,7 +104,7 @@ func (pe *PathEnd) ConnTry(
dst.ClientID,
cs,
defaultChainPrefix,
conntypes.ExportedVersionsToProto(conntypes.GetCompatibleVersions()),
conntypes.GetCompatibleVersions(),
DefaultDelayPeriod,
dstConnState.Proof,
dstClientState.Proof,
Expand Down Expand Up @@ -141,7 +141,7 @@ func (pe *PathEnd) ConnAck(
dstConsState.Proof,
dstConsState.ProofHeight,
cs.GetLatestHeight().(clienttypes.Height),
conntypes.ExportedVersionsToProto(conntypes.GetCompatibleVersions())[0],
conntypes.GetCompatibleVersions()[0],
signer.String(),
)
}
Expand Down
4 changes: 2 additions & 2 deletions core/provers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

"github.com/cosmos/cosmos-sdk/codec"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
)

// Prover represents a prover that supports generating a commitment proof
Expand Down
10 changes: 5 additions & 5 deletions core/query.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package core

import (
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
conntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
host "github.com/cosmos/ibc-go/v8/modules/core/24-host"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion core/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func SendCheckMsgs(chain Chain, msgs []types.Msg) bool {
logger := GetChainLogger(chain)
now := time.Now()
if _, err := chain.SendMsgs(msgs); err != nil {
GetChainLogger(chain).Error("failed to send msgs", err, "msgs", msgs)
GetChainLogger(chain).Error("failed to send msgs", err)
return false
}
logger.TimeTrack(now, "SendMsgs", "num_msgs", len(msgs))
Expand Down
4 changes: 2 additions & 2 deletions core/types.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package core

import (
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
)

// PacketInfo represents the packet information that is acquired from a SendPacket event or
Expand Down
2 changes: 1 addition & 1 deletion core/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"slices"
"testing"

chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
"github.com/hyperledger-labs/yui-relayer/core"
)

Expand Down
Loading

0 comments on commit 82d246f

Please sign in to comment.