Skip to content

Commit cedbb0f

Browse files
jtierimergify[bot]
authored andcommitted
fix: support amino encoding on MsgRecoverClient (#8448)
Co-authored-by: Gjermund Garaba <gjermund@garaba.net> (cherry picked from commit de2f70a) # Conflicts: # modules/core/02-client/types/codec.go # modules/core/02-client/types/tx.pb.go
1 parent bf74892 commit cedbb0f

File tree

4 files changed

+80
-2
lines changed

4 files changed

+80
-2
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
package types
22

33
import (
4+
<<<<<<< HEAD
45
proto "github.com/cosmos/gogoproto/proto"
6+
=======
7+
"github.com/cosmos/cosmos-sdk/codec"
8+
"github.com/cosmos/cosmos-sdk/codec/legacy"
9+
"github.com/cosmos/gogoproto/proto"
10+
>>>>>>> de2f70a4 (fix: support amino encoding on MsgRecoverClient (#8448))
511

612
errorsmod "cosmossdk.io/errors"
713

@@ -14,6 +20,12 @@ import (
1420
"github.com/cosmos/ibc-go/v8/modules/core/exported"
1521
)
1622

23+
// RegisterLegacyAminoCodec registers the necessary interfaces and concrete types
24+
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
25+
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
26+
legacy.RegisterAminoMsg(cdc, &MsgRecoverClient{}, "cosmos-sdk/MsgRecoverClient")
27+
}
28+
1729
// RegisterInterfaces registers the client interfaces to protobuf Any.
1830
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
1931
registry.RegisterInterface(

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

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/module.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ func (AppModule) IsOnePerModuleType() {}
5858
// IsAppModule implements the appmodule.AppModule interface.
5959
func (AppModule) IsAppModule() {}
6060

61-
// RegisterLegacyAminoCodec does nothing. IBC does not support amino.
62-
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {}
61+
// RegisterLegacyAminoCodec implements AppModuleBasic interface.
62+
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
63+
clienttypes.RegisterLegacyAminoCodec(cdc)
64+
}
6365

6466
// DefaultGenesis returns default genesis state as raw bytes for the ibc
6567
// module.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package ibc.core.client.v1;
44

55
option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types";
66

7+
import "amino/amino.proto";
78
import "cosmos/msg/v1/msg.proto";
89
import "cosmos/upgrade/v1beta1/upgrade.proto";
910
import "gogoproto/gogo.proto";
@@ -120,6 +121,7 @@ message MsgSubmitMisbehaviourResponse {}
120121

121122
// MsgRecoverClient defines the message used to recover a frozen or expired client.
122123
message MsgRecoverClient {
124+
option (amino.name) = "cosmos-sdk/MsgRecoverClient";
123125
option (gogoproto.goproto_getters) = false;
124126
option (cosmos.msg.v1.signer) = "signer";
125127

0 commit comments

Comments
 (0)