Skip to content

Commit

Permalink
resolve conflict with a same name for MsgUpdateEpochParams from staking.
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed Feb 21, 2024
1 parent 8f2563e commit abf6832
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 80 deletions.
6 changes: 3 additions & 3 deletions proto/composable/ibctransfermiddleware/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ option go_package = "x/ibctransfermiddleware/types";
service Msg {
option (cosmos.msg.v1.service) = true;

rpc UpdateEpochParams(MsgUpdateEpochParams) returns (MsgUpdateParamsEpochResponse);
rpc UpdateEpochParams(MsgUpdateCustomIbcParams) returns (MsgUpdateParamsCustomIbcResponse);
}

// MsgUpdateParams is the Msg/UpdateParams request type.
//
// Since: cosmos-sdk 0.47
message MsgUpdateEpochParams {
message MsgUpdateCustomIbcParams {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "composable/x/ibctransfermiddleware/MsgUpdateParams";

Expand All @@ -38,4 +38,4 @@ message MsgUpdateEpochParams {
// MsgUpdateParams message.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParamsEpochResponse {}
message MsgUpdateParamsCustomIbcResponse {}
4 changes: 2 additions & 2 deletions x/ibctransfermiddleware/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewMsgServerImpl(k Keeper) types.MsgServer {
}

// UpdateParams updates the params.
func (ms msgServer) UpdateEpochParams(goCtx context.Context, req *types.MsgUpdateEpochParams) (*types.MsgUpdateParamsEpochResponse, error) {
func (ms msgServer) UpdateEpochParams(goCtx context.Context, req *types.MsgUpdateCustomIbcParams) (*types.MsgUpdateParamsCustomIbcResponse, error) {
if ms.authority != req.Authority {
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority)
}
Expand All @@ -34,5 +34,5 @@ func (ms msgServer) UpdateEpochParams(goCtx context.Context, req *types.MsgUpdat
return nil, err
}

return &types.MsgUpdateParamsEpochResponse{}, nil
return &types.MsgUpdateParamsCustomIbcResponse{}, nil
}
4 changes: 2 additions & 2 deletions x/ibctransfermiddleware/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
// RegisterLegacyAminoCodec registers the account interfaces and concrete types on the
// provided LegacyAmino codec. These types are used for Amino JSON serialization
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
legacy.RegisterAminoMsg(cdc, &MsgUpdateEpochParams{}, "composable/MsgUpdateEpochParams")
legacy.RegisterAminoMsg(cdc, &MsgUpdateCustomIbcParams{}, "composable/MsgUpdateCustomIbcParams")
}

func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgUpdateEpochParams{},
&MsgUpdateCustomIbcParams{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
Expand Down
8 changes: 4 additions & 4 deletions x/ibctransfermiddleware/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var _ sdk.Msg = &MsgUpdateEpochParams{}
var _ sdk.Msg = &MsgUpdateCustomIbcParams{}

// GetSignBytes implements the LegacyMsg interface.
func (m MsgUpdateEpochParams) GetSignBytes() []byte {
func (m MsgUpdateCustomIbcParams) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

// GetSigners returns the expected signers for a MsgUpdateParams message.
func (m *MsgUpdateEpochParams) GetSigners() []sdk.AccAddress {
func (m *MsgUpdateCustomIbcParams) GetSigners() []sdk.AccAddress {
addr, _ := sdk.AccAddressFromBech32(m.Authority)
return []sdk.AccAddress{addr}
}

// ValidateBasic does a sanity check on the provided data.
func (m *MsgUpdateEpochParams) ValidateBasic() error {
func (m *MsgUpdateCustomIbcParams) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil {
return errorsmod.Wrapf(err, "invalid authority address")
}
Expand Down
Loading

0 comments on commit abf6832

Please sign in to comment.