本文档旨在突出显示那些可能需要比 CHANGELOG 中提供的更多信息的重要变更。 任何需要由 ibc-go 使用者执行的变更,都应记录在此处。 本文档根据四类潜在用户群体分为四个部分: 注意: ibc-go 遵循 golang 语义化版本控制,因此在主版本发布时,所有导入路径都必须更新以提升版本号。
github.com/cosmos/ibc-go/v4 -> github.com/cosmos/ibc-go/v5

链

Ante 装饰器

core/ante 中的 AnteDecorator 类型已重命名为 RedundantRelayDecorator(对应的构造函数也重命名为 NewRedundantRelayDecorator)。因此,在创建 sdk.AnteHandler 类型实例的函数中(例如 NewAnteHandler),变更如下所示:
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
  / parameter validation

  anteDecorators := []sdk.AnteDecorator{
    / other ante decorators
-   ibcante.NewAnteDecorator(opts.IBCkeeper),
+   ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
  }

  return sdk.ChainAnteDecorators(anteDecorators...), nil
}
AnteDecorator 实际上曾被重命名过两次,但你可以在这个 PR中查看最终一次重命名所做的修改。

IBC 应用

Core

modules/core/keeper 中 NewKeeper 函数的 key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   stakingKeeper clienttypes.StakingKeeper,
   upgradeKeeper clienttypes.UpgradeKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
) *Keeper
modules/core 中的 RegisterRESTRoutes 函数已被移除。

ICS03 - Connection

modules/core/03-connection/keeper 中 NewKeeper 函数的 key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ck types.ClientKeeper
) Keeper

ICS04 - Channel

modules/core/04-channel/types 中的 NewPacketId 函数已重命名为 NewPacketID:
-  func NewPacketId(
+  func NewPacketID(
  portID,
  channelID string,
  seq uint64
) PacketId
modules/core/04-channel/keeper 中 NewKeeper 函数的 key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   clientKeeper types.ClientKeeper,
   connectionKeeper types.ConnectionKeeper,
   portKeeper types.PortKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper

ICS20 - Transfer

modules/apps/transfer/keeper 中 NewKeeper 函数的 key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ics4Wrapper types.ICS4Wrapper,
   channelKeeper types.ChannelKeeper,
   portKeeper types.PortKeeper,
   authKeeper types.AccountKeeper,
   bankKeeper types.BankKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper
modules/apps/transfer/types 中 GetTransferCoin 函数的 amount 参数现在的类型为 math.Int("cosmossdk.io/math"):
func GetTransferCoin(
   portID, channelID, baseDenom string,
-  amount sdk.Int
+  amount math.Int
) sdk.Coin
modules/apps/transfer 中的 RegisterRESTRoutes 函数已被移除。

ICS27 - Interchain Accounts

以下位置中 NewKeeper 函数的 key 和 msgRouter 参数类型已发生变化:
  • modules/apps/27-interchain-accounts/controller/keeper
  • modules/apps/27-interchain-accounts/host/keeper
key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名),而 msgRouter 参数现在的类型为 *icatypes.MessageRouter(其中 icatypes 是对 "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" 的导入别名):
/ NewKeeper creates a new interchain accounts controller Keeper instance
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ics4Wrapper icatypes.ICS4Wrapper,
   channelKeeper icatypes.ChannelKeeper,
   portKeeper icatypes.PortKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
-  msgRouter *baseapp.MsgServiceRouter,
+  msgRouter *icatypes.MessageRouter,
) Keeper
/ NewKeeper creates a new interchain accounts host Keeper instance
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   channelKeeper icatypes.ChannelKeeper,
   portKeeper icatypes.PortKeeper,
   accountKeeper icatypes.AccountKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
-  msgRouter *baseapp.MsgServiceRouter,
+  msgRouter *icatypes.MessageRouter,
) Keeper
新的 MessageRouter 接口定义如下:
type MessageRouter interface {
    Handler(msg sdk.Msg)

baseapp.MsgServiceHandler
}
modules/apps/27-interchain-accounts 中的 RegisterRESTRoutes 函数已被移除。 modules/apps/27-interchain-accounts/host/keeper 中 host 子模块的 NewKeeper 函数新增了一个参数 ics4Wrapper。 这使得 host 子模块能够在 OnChanOpenTry 回调中,为通道重新打开握手正确解包通道版本。
func NewKeeper(
   cdc codec.BinaryCodec,
   key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
+  ics4Wrapper icatypes.ICS4Wrapper,
   channelKeeper icatypes.ChannelKeeper,
   portKeeper icatypes.PortKeeper,
   accountKeeper icatypes.AccountKeeper,
   scopedKeeper icatypes.ScopedKeeper,
   msgRouter icatypes.MessageRouter,
) Keeper

数据包确认中的 Cosmos SDK 消息处理器响应

主机链上消息执行的交易响应构造方式已发生变化。sdk.TxMsgData 中的 Data 字段已被弃用,自 Cosmos SDK 0.46 起,MsgResponses 字段会保存打包为 Any 的消息处理器响应。 对于使用 Cosmos SDK 0.45 及以下版本的链,消息响应的构造方式如下:
txMsgData := &sdk.TxMsgData{
    Data: make([]*sdk.MsgData, len(msgs)),
}
    for i, msg := range msgs {
  / message validation

  msgResponse, err := k.executeMsg(cacheCtx, msg)
  / return if err != nil

  txMsgData.Data[i] = &sdk.MsgData{
    MsgType: sdk.MsgTypeURL(msg),
    Data:    msgResponse,
}
}

/ emit events

txResponse, err := proto.Marshal(txMsgData)
/ return if err != nil

return txResponse, nil
对于使用 Cosmos SDK 0.46 及以上版本的链,现在改为如下方式:
txMsgData := &sdk.TxMsgData{
    MsgResponses: make([]*codectypes.Any, len(msgs)),
}
    for i, msg := range msgs {
  / message validation

  protoAny, err := k.executeMsg(cacheCtx, msg)
  / return if err != nil

  txMsgData.MsgResponses[i] = protoAny
}

/ emit events

txResponse, err := proto.Marshal(txMsgData)
/ return if err != nil

return txResponse, nil
在自定义 ICA controller 模块的 OnAcknowledgementPacket 回调中处理确认时,需要根据 txMsgData.Data 是否为空来决定处理消息处理器响应的逻辑。只有使用 Cosmos SDK 0.46 或以上版本的 controller 链,才能编写处理来自 Cosmos SDK 0.46 或以上版本 host 链响应所需的逻辑。
var ack channeltypes.Acknowledgement
    if err := channeltypes.SubModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil {
    return err
}

var txMsgData sdk.TxMsgData
    if err := proto.Unmarshal(ack.GetResult(), txMsgData); err != nil {
    return err
}
    switch len(txMsgData.Data) {
    case 0: / for SDK 0.46 and above
    for _, msgResponse := range txMsgData.MsgResponses {
    / unmarshall msgResponse and execute logic based on the response
}

return nil
default: / for SDK 0.45 and below
    for _, msgData := range txMsgData.Data {
    / unmarshall msgData and execute logic based on the response
}
}
更多信息请参阅对应的认证模块文档。

ICS29 - Fee Middleware

modules/apps/29-fee 中 NewKeeper 函数的 key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ics4Wrapper types.ICS4Wrapper,
   channelKeeper types.ChannelKeeper,
   portKeeper types.PortKeeper,
   authKeeper types.AccountKeeper,
   bankKeeper types.BankKeeper,
) Keeper
modules/apps/29-fee 中的 RegisterRESTRoutes 函数已被移除。

IBC 测试包

MockIBCApp 类型已重命名为 IBCApp(对应的构造函数也重命名为 NewIBCApp)。因此带来了以下变化:
  • testing/mock 中 *IBCModule 的 IBCApp 字段类型也变更为 *IBCApp:
type IBCModule struct {
   appModule *AppModule
-  IBCApp    *MockIBCApp / base application of an IBC middleware stack
+  IBCApp    *IBCApp / base application of an IBC middleware stack
}
  • testing/mock 中 *NewIBCModule 的 app 参数类型也变更为 *IBCApp:
func NewIBCModule(
   appModule *AppModule,
-  app *MockIBCApp
+  app *IBCApp
) IBCModule
MockEmptyAcknowledgement 类型已重命名为 EmptyAcknowledgement(对应的构造函数也重命名为 NewEmptyAcknowledgement)。 testing 中的 TestingApp 接口也经历了一些修改:
  • GetStakingKeeper 函数的返回类型不再是具体类型 stakingkeeper.Keeper(其中 stakingkeeper 是对 "github.com/cosmos/cosmos-sdk/x/staking/keeper" 的导入别名),而是改为接口 ibctestingtypes.StakingKeeper(其中 ibctestingtypes 是对 ""github.com/cosmos/ibc-go/v5/testing/types" 的导入别名)。更多细节请参见此 PR。StakingKeeper 接口定义如下:
type StakingKeeper interface {
    GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
}
  • LastCommitID 函数的返回类型已变更为 storetypes.CommitID(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名)。
更多细节请参见下面的 git diff:
type TestingApp interface {
   abci.Application

   / ibc-go additions
   GetBaseApp() *baseapp.BaseApp
-  GetStakingKeeper() stakingkeeper.Keeper
+  GetStakingKeeper() ibctestingtypes.StakingKeeper
   GetIBCKeeper() *keeper.Keeper
   GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
   GetTxConfig() client.TxConfig

   / Implemented by SimApp
   AppCodec() codec.Codec

   / Implemented by BaseApp
-  LastCommitID() sdk.CommitID
+  LastCommitID() storetypes.CommitID
   LastBlockHeight() int64
}
testing 中 SetupWithGenesisValSet 函数的 powerReduction 参数现在的类型为 math.Int("cosmossdk.io/math"):
func SetupWithGenesisValSet(
   t *testing.T,
   valSet *tmtypes.ValidatorSet,
   genAccs []authtypes.GenesisAccount,
   chainID string,
-  powerReduction sdk.Int,
+  powerReduction math.Int,
   balances ...banktypes.Balance
) TestingApp
testing/simapp 中以下函数的 accAmt 参数现在的类型为 math.Int("cosmossdk.io/math"):
  • AddTestAddrsFromPubKeys ,
  • AddTestAddrs
  • 以及 AddTestAddrsIncremental
func AddTestAddrsFromPubKeys(
   app *SimApp,
   ctx sdk.Context,
   pubKeys []cryptotypes.PubKey,
-  accAmt sdk.Int,
+  accAmt math.Int
)
func addTestAddrs(
   app *SimApp,
   ctx sdk.Context,
   accNum int,
-  accAmt sdk.Int,
+  accAmt math.Int,
   strategy GenerateAccountStrategy
) []sdk.AccAddress
func AddTestAddrsIncremental(
   app *SimApp,
   ctx sdk.Context,
   accNum int,
-  accAmt sdk.Int,
+  accAmt math.Int
) []sdk.AccAddress
testing/mock 中的 RegisterRESTRoutes 函数已被移除。

Relayers

  • 此版本没有相关变更。

IBC 轻客户端

ICS02 - Client

modules/core/02-client/keeper 中 NewKeeper 函数的 key 参数现在的类型为 storetypes.StoreKey(其中 storetypes 是对 "github.com/cosmos/cosmos-sdk/store/types" 的导入别名):
func NewKeeper(
  cdc codec.BinaryCodec,
- key sdk.StoreKey,
+ key storetypes.StoreKey,
  paramSpace paramtypes.Subspace,
  sk types.StakingKeeper,
  uk types.UpgradeKeeper
) Keeper

This document is intended to highlight significant changes which may require more information than presented in the CHANGELOG. Any changes that must be done by a user of ibc-go should be documented here. There are four sections based on the four potential user groups of this document: Note: ibc-go supports golang semantic versioning and therefore all imports must be updated to bump the version number on major releases.
github.com/cosmos/ibc-go/v4 -> github.com/cosmos/ibc-go/v5

Chains

Ante decorator

The AnteDecorator type in core/ante has been renamed to RedundantRelayDecorator (and the corresponding constructor function to NewRedundantRelayDecorator). Therefore in the function that creates the instance of the sdk.AnteHandler type (e.g. NewAnteHandler) the change would be like this:
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
  / parameter validation

  anteDecorators := []sdk.AnteDecorator{
    / other ante decorators
-   ibcante.NewAnteDecorator(opts.IBCkeeper),
+   ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
  }

  return sdk.ChainAnteDecorators(anteDecorators...), nil
}
The AnteDecorator was actually renamed twice, but in this PR you can see the changes made for the final rename.

IBC Apps

Core

The key parameter of the NewKeeper function in modules/core/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   stakingKeeper clienttypes.StakingKeeper,
   upgradeKeeper clienttypes.UpgradeKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
) *Keeper
The RegisterRESTRoutes function in modules/core has been removed.

ICS03 - Connection

The key parameter of the NewKeeper function in modules/core/03-connection/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ck types.ClientKeeper
) Keeper

ICS04 - Channel

The function NewPacketId in modules/core/04-channel/types has been renamed to NewPacketID:
-  func NewPacketId(
+  func NewPacketID(
  portID,
  channelID string,
  seq uint64
) PacketId
The key parameter of the NewKeeper function in modules/core/04-channel/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   clientKeeper types.ClientKeeper,
   connectionKeeper types.ConnectionKeeper,
   portKeeper types.PortKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper

ICS20 - Transfer

The key parameter of the NewKeeper function in modules/apps/transfer/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ics4Wrapper types.ICS4Wrapper,
   channelKeeper types.ChannelKeeper,
   portKeeper types.PortKeeper,
   authKeeper types.AccountKeeper,
   bankKeeper types.BankKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper
The amount parameter of function GetTransferCoin in modules/apps/transfer/types is now of type math.Int ("cosmossdk.io/math"):
func GetTransferCoin(
   portID, channelID, baseDenom string,
-  amount sdk.Int
+  amount math.Int
) sdk.Coin
The RegisterRESTRoutes function in modules/apps/transfer has been removed.

ICS27 - Interchain Accounts

The key and msgRouter parameters of the NewKeeper functions in
  • modules/apps/27-interchain-accounts/controller/keeper
  • and modules/apps/27-interchain-accounts/host/keeper
have changed type. The key parameter is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"), and the msgRouter parameter is now of type *icatypes.MessageRouter (where icatypes is an import alias for "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"):
/ NewKeeper creates a new interchain accounts controller Keeper instance
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ics4Wrapper icatypes.ICS4Wrapper,
   channelKeeper icatypes.ChannelKeeper,
   portKeeper icatypes.PortKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
-  msgRouter *baseapp.MsgServiceRouter,
+  msgRouter *icatypes.MessageRouter,
) Keeper
/ NewKeeper creates a new interchain accounts host Keeper instance
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   channelKeeper icatypes.ChannelKeeper,
   portKeeper icatypes.PortKeeper,
   accountKeeper icatypes.AccountKeeper,
   scopedKeeper capabilitykeeper.ScopedKeeper,
-  msgRouter *baseapp.MsgServiceRouter,
+  msgRouter *icatypes.MessageRouter,
) Keeper
The new MessageRouter interface is defined as:
type MessageRouter interface {
    Handler(msg sdk.Msg)

baseapp.MsgServiceHandler
}
The RegisterRESTRoutes function in modules/apps/27-interchain-accounts has been removed. An additional parameter, ics4Wrapper has been added to the host submodule NewKeeper function in modules/apps/27-interchain-accounts/host/keeper. This allows the host submodule to correctly unwrap the channel version for channel reopening handshakes in the OnChanOpenTry callback.
func NewKeeper(
   cdc codec.BinaryCodec,
   key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
+  ics4Wrapper icatypes.ICS4Wrapper,
   channelKeeper icatypes.ChannelKeeper,
   portKeeper icatypes.PortKeeper,
   accountKeeper icatypes.AccountKeeper,
   scopedKeeper icatypes.ScopedKeeper,
   msgRouter icatypes.MessageRouter,
) Keeper

Cosmos SDK message handler responses in packet acknowledgement

The construction of the transaction response of a message execution on the host chain has changed. The Data field in the sdk.TxMsgData has been deprecated and since Cosmos SDK 0.46 the MsgResponses field contains the message handler responses packed into Anys. For chains on Cosmos SDK 0.45 and below, the message response was constructed like this:
txMsgData := &sdk.TxMsgData{
    Data: make([]*sdk.MsgData, len(msgs)),
}
    for i, msg := range msgs {
  / message validation

  msgResponse, err := k.executeMsg(cacheCtx, msg)
  / return if err != nil

  txMsgData.Data[i] = &sdk.MsgData{
    MsgType: sdk.MsgTypeURL(msg),
    Data:    msgResponse,
}
}

/ emit events

txResponse, err := proto.Marshal(txMsgData)
/ return if err != nil

return txResponse, nil
And for chains on Cosmos SDK 0.46 and above, it is now done like this:
txMsgData := &sdk.TxMsgData{
    MsgResponses: make([]*codectypes.Any, len(msgs)),
}
    for i, msg := range msgs {
  / message validation

  protoAny, err := k.executeMsg(cacheCtx, msg)
  / return if err != nil

  txMsgData.MsgResponses[i] = protoAny
}

/ emit events

txResponse, err := proto.Marshal(txMsgData)
/ return if err != nil

return txResponse, nil
When handling the acknowledgement in the OnAcknowledgementPacket callback of a custom ICA controller module, then depending on whether txMsgData.Data is empty or not, the logic to handle the message handler response will be different. Only controller chains on Cosmos SDK 0.46 or above will be able to write the logic needed to handle the response from a host chain on Cosmos SDK 0.46 or above.
var ack channeltypes.Acknowledgement
    if err := channeltypes.SubModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil {
    return err
}

var txMsgData sdk.TxMsgData
    if err := proto.Unmarshal(ack.GetResult(), txMsgData); err != nil {
    return err
}
    switch len(txMsgData.Data) {
    case 0: / for SDK 0.46 and above
    for _, msgResponse := range txMsgData.MsgResponses {
    / unmarshall msgResponse and execute logic based on the response
}

return nil
default: / for SDK 0.45 and below
    for _, msgData := range txMsgData.Data {
    / unmarshall msgData and execute logic based on the response
}
}
See the corresponding documentation about authentication modules for more information.

ICS29 - Fee Middleware

The key parameter of the NewKeeper function in modules/apps/29-fee is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper(
   cdc codec.BinaryCodec,
-  key sdk.StoreKey,
+  key storetypes.StoreKey,
   paramSpace paramtypes.Subspace,
   ics4Wrapper types.ICS4Wrapper,
   channelKeeper types.ChannelKeeper,
   portKeeper types.PortKeeper,
   authKeeper types.AccountKeeper,
   bankKeeper types.BankKeeper,
) Keeper
The RegisterRESTRoutes function in modules/apps/29-fee has been removed.

IBC testing package

The MockIBCApp type has been renamed to IBCApp (and the corresponding constructor function to NewIBCApp). This has resulted therefore in:
  • The IBCApp field of the *IBCModule in testing/mock to change its type as well to *IBCApp:
type IBCModule struct {
   appModule *AppModule
-  IBCApp    *MockIBCApp / base application of an IBC middleware stack
+  IBCApp    *IBCApp / base application of an IBC middleware stack
}
  • The app parameter to *NewIBCModule in testing/mock to change its type as well to *IBCApp:
func NewIBCModule(
   appModule *AppModule,
-  app *MockIBCApp
+  app *IBCApp
) IBCModule
The MockEmptyAcknowledgement type has been renamed to EmptyAcknowledgement (and the corresponding constructor function to NewEmptyAcknowledgement). The TestingApp interface in testing has gone through some modifications:
  • The return type of the function GetStakingKeeper is not the concrete type stakingkeeper.Keeper anymore (where stakingkeeper is an import alias for "github.com/cosmos/cosmos-sdk/x/staking/keeper"), but it has been changed to the interface ibctestingtypes.StakingKeeper (where ibctestingtypes is an import alias for ""github.com/cosmos/ibc-go/v5/testing/types"). See this PR for more details. The StakingKeeper interface is defined as:
type StakingKeeper interface {
    GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
}
  • The return type of the function LastCommitID has changed to storetypes.CommitID (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types").
See the following git diff for more details:
type TestingApp interface {
   abci.Application

   / ibc-go additions
   GetBaseApp() *baseapp.BaseApp
-  GetStakingKeeper() stakingkeeper.Keeper
+  GetStakingKeeper() ibctestingtypes.StakingKeeper
   GetIBCKeeper() *keeper.Keeper
   GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
   GetTxConfig() client.TxConfig

   / Implemented by SimApp
   AppCodec() codec.Codec

   / Implemented by BaseApp
-  LastCommitID() sdk.CommitID
+  LastCommitID() storetypes.CommitID
   LastBlockHeight() int64
}
The powerReduction parameter of the function SetupWithGenesisValSet in testing is now of type math.Int ("cosmossdk.io/math"):
func SetupWithGenesisValSet(
   t *testing.T,
   valSet *tmtypes.ValidatorSet,
   genAccs []authtypes.GenesisAccount,
   chainID string,
-  powerReduction sdk.Int,
+  powerReduction math.Int,
   balances ...banktypes.Balance
) TestingApp
The accAmt parameter of the functions
  • AddTestAddrsFromPubKeys ,
  • AddTestAddrs
  • and AddTestAddrsIncremental
in testing/simapp are now of type math.Int ("cosmossdk.io/math"):
func AddTestAddrsFromPubKeys(
   app *SimApp,
   ctx sdk.Context,
   pubKeys []cryptotypes.PubKey,
-  accAmt sdk.Int,
+  accAmt math.Int
)
func addTestAddrs(
   app *SimApp,
   ctx sdk.Context,
   accNum int,
-  accAmt sdk.Int,
+  accAmt math.Int,
   strategy GenerateAccountStrategy
) []sdk.AccAddress
func AddTestAddrsIncremental(
   app *SimApp,
   ctx sdk.Context,
   accNum int,
-  accAmt sdk.Int,
+  accAmt math.Int
) []sdk.AccAddress
The RegisterRESTRoutes function in testing/mock has been removed.

Relayers

  • No relevant changes were made in this release.

IBC Light Clients

ICS02 - Client

The key parameter of the NewKeeper function in modules/core/02-client/keeper is now of type storetypes.StoreKey (where storetypes is an import alias for "github.com/cosmos/cosmos-sdk/store/types"):
func NewKeeper(
  cdc codec.BinaryCodec,
- key sdk.StoreKey,
+ key storetypes.StoreKey,
  paramSpace paramtypes.Subspace,
  sk types.StakingKeeper,
  uk types.UpgradeKeeper
) Keeper