Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename client update param messages to match other modules. #3708

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/core/02-client/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
&MsgUpdateClient{},
&MsgUpgradeClient{},
&MsgSubmitMisbehaviour{},
&MsgUpdateClientParams{},
&MsgUpdateParams{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
Expand Down
16 changes: 8 additions & 8 deletions modules/core/02-client/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
_ sdk.Msg = (*MsgUpdateClient)(nil)
_ sdk.Msg = (*MsgSubmitMisbehaviour)(nil)
_ sdk.Msg = (*MsgUpgradeClient)(nil)
_ sdk.Msg = (*MsgUpdateClientParams)(nil)
_ sdk.Msg = (*MsgUpdateParams)(nil)

_ codectypes.UnpackInterfacesMessage = (*MsgCreateClient)(nil)
_ codectypes.UnpackInterfacesMessage = (*MsgUpdateClient)(nil)
Expand Down Expand Up @@ -266,25 +266,25 @@ func (msg MsgSubmitMisbehaviour) UnpackInterfaces(unpacker codectypes.AnyUnpacke
return unpacker.UnpackAny(msg.Misbehaviour, &misbehaviour)
}

// NewMsgUpdateClientParams creates a new instance of MsgUpdateClientParams.
func NewMsgUpdateClientParams(authority string, params Params) *MsgUpdateClientParams {
return &MsgUpdateClientParams{
// NewMsgUpdateParams creates a new instance of MsgUpdateParams.
func NewMsgUpdateParams(authority string, params Params) *MsgUpdateParams {
return &MsgUpdateParams{
Authority: authority,
Params: params,
}
}

// GetSigners returns the expected signers for a MsgUpdateClientParams message.
func (msg *MsgUpdateClientParams) GetSigners() []sdk.AccAddress {
// GetSigners returns the expected signers for a MsgUpdateParams message.
func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress {
accAddr, err := sdk.AccAddressFromBech32(msg.Authority)
if err != nil {
panic(err)
}
return []sdk.AccAddress{accAddr}
}

// ValidateBasic performs basic checks on a MsgUpdateClientParams.
func (msg *MsgUpdateClientParams) ValidateBasic() error {
// ValidateBasic performs basic checks on a MsgUpdateParams.
func (msg *MsgUpdateParams) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
return errorsmod.Wrapf(ibcerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err)
}
Expand Down
14 changes: 7 additions & 7 deletions modules/core/02-client/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,32 +610,32 @@ func (suite *TypesTestSuite) TestMsgSubmitMisbehaviour_ValidateBasic() {
}
}

// TestMsgUpdateClientParams_ValidateBasic tests ValidateBasic for MsgUpdateClientParams
func (suite *TypesTestSuite) TestMsgUpdateClientParams_ValidateBasic() {
// TestMsgUpdateParams_ValidateBasic tests ValidateBasic for MsgUpdateParams
func (suite *TypesTestSuite) TestMsgUpdateParams_ValidateBasic() {
authority := suite.chainA.App.GetIBCKeeper().GetAuthority()
testCases := []struct {
name string
msg *types.MsgUpdateClientParams
msg *types.MsgUpdateParams
expPass bool
}{
{
"success: valid authority and params",
types.NewMsgUpdateClientParams(authority, types.DefaultParams()),
types.NewMsgUpdateParams(authority, types.DefaultParams()),
true,
},
{
"success: valid authority empty params",
types.NewMsgUpdateClientParams(authority, types.Params{}),
types.NewMsgUpdateParams(authority, types.Params{}),
true,
},
{
"failure: invalid authority address",
types.NewMsgUpdateClientParams("invalid", types.DefaultParams()),
types.NewMsgUpdateParams("invalid", types.DefaultParams()),
false,
},
{
"failure: invalid allowed client",
types.NewMsgUpdateClientParams(authority, types.NewParams("")),
types.NewMsgUpdateParams(authority, types.NewParams("")),
false,
},
}
Expand Down
Loading