Skip to content

Commit 64e0a1e

Browse files
committed
Address initial feedback.
1 parent 731a0af commit 64e0a1e

File tree

8 files changed

+62
-79
lines changed

8 files changed

+62
-79
lines changed

modules/core/02-client/exported/exported.go

-18
This file was deleted.

modules/core/02-client/keeper/keeper.go

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type Keeper struct {
3333
stakingKeeper types.StakingKeeper
3434
upgradeKeeper types.UpgradeKeeper
3535

36+
// the address capable of executing a MsgUpdateClientParams message. Typically, this
37+
// should be the x/gov module account.
3638
authority string
3739
}
3840

modules/core/02-client/keeper/params.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ func (k Keeper) GetAllowedClients(ctx sdk.Context) []string {
1414

1515
// GetParams returns the total set of ibc-client parameters.
1616
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
17+
var p types.Params
1718
store := ctx.KVStore(k.storeKey)
1819
bz := store.Get([]byte(types.ParamsKey))
1920
if bz == nil {
20-
panic("ibc client params are not set in store")
21+
return p
2122
}
2223

23-
var p types.Params
2424
k.cdc.MustUnmarshal(bz, &p)
2525
return p
2626
}

modules/core/02-client/keeper/params_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ func (suite *KeeperTestSuite) TestParams() {
4646
}
4747
}
4848

49-
// TestUnsetParams tests that trying to get params that are not set panics.
49+
// TestUnsetParams tests that trying to get params that are not set returns empty params.
5050
func (suite *KeeperTestSuite) TestUnsetParams() {
5151
suite.SetupTest()
5252
ctx := suite.chainA.GetContext()
5353
store := ctx.KVStore(suite.chainA.GetSimApp().GetKey(ibcexported.StoreKey))
5454
store.Delete([]byte(types.ParamsKey))
5555

56-
suite.Require().Panics(func() {
57-
suite.chainA.GetSimApp().IBCKeeper.ClientKeeper.GetParams(ctx)
58-
})
56+
suite.Require().Equal(suite.chainA.GetSimApp().IBCKeeper.ClientKeeper.GetParams(ctx), types.Params{})
5957
}

modules/core/02-client/types/params_legacy.go

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov
3+
controlled execution of MsgUpdateParams messages. These types remains solely
4+
for migration purposes and will be removed in a future release.
5+
[#3621](https://github.com/cosmos/ibc-go/issues/3621)
6+
*/
17
package types
28

39
import (

modules/core/02-client/types/params_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ func TestIsAllowedClient(t *testing.T) {
1515
params Params
1616
expPass bool
1717
}{
18-
{"valid client", exported.Tendermint, DefaultParams(), true},
19-
{"valid client with custom params", exported.Tendermint, NewParams(exported.Tendermint), true},
20-
{"invalid blank client", " ", DefaultParams(), false},
21-
{"invalid client with custom params", exported.Localhost, NewParams(exported.Tendermint), false},
18+
{"success: valid client", exported.Tendermint, DefaultParams(), true},
19+
{"success: valid client with custom params", exported.Tendermint, NewParams(exported.Tendermint), true},
20+
{"success: invalid blank client", " ", DefaultParams(), false},
21+
{"success: invalid client with custom params", exported.Localhost, NewParams(exported.Tendermint), false},
2222
}
2323

2424
for _, tc := range testCases {

modules/core/02-client/types/tx.pb.go

+45-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/ibc/core/client/v1/tx.proto

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ package ibc.core.client.v1;
55
option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types";
66

77
import "cosmos_proto/cosmos.proto";
8-
import "cosmos/msg/v1/msg.proto";
9-
import "ibc/core/client/v1/client.proto";
108
import "gogoproto/gogo.proto";
119
import "google/protobuf/any.proto";
10+
import "ibc/core/client/v1/client.proto";
1211

1312
// Msg defines the ibc/client Msg service.
1413
service Msg {
@@ -107,8 +106,6 @@ message MsgSubmitMisbehaviourResponse {}
107106

108107
// MsgUpdateClientParams defines the sdk.Msg type to update the client parameters.
109108
message MsgUpdateClientParams {
110-
option (cosmos.msg.v1.signer) = "authority";
111-
112109
// authority is the address of the governance account.
113110
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
114111

0 commit comments

Comments
 (0)