-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
576 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package types | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
) | ||
|
||
const TypeMsgUpdateParams = "update_params" | ||
|
||
// Route returns the route of MsgUpdateParams. | ||
func (msg *MsgUpdateParamsRequest) Route() string { | ||
return RouterKey | ||
} | ||
|
||
// Type returns the type of MsgUpdateParams. | ||
func (msg *MsgUpdateParamsRequest) Type() string { | ||
return TypeMsgUpdateParams | ||
} | ||
|
||
// GetSignBytes implements the LegacyMsg interface. | ||
func (m MsgUpdateParamsRequest) GetSignBytes() []byte { | ||
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) | ||
} | ||
|
||
// GetSigners returns the expected signers for a MsgUpdateParams message. | ||
func (m *MsgUpdateParamsRequest) GetSigners() []sdk.AccAddress { | ||
addr, _ := sdk.AccAddressFromBech32(m.Authority) | ||
return []sdk.AccAddress{addr} | ||
} | ||
|
||
// ValidateBasic performs basic MsgUpdateParams message validation. | ||
func (m *MsgUpdateParamsRequest) ValidateBasic() error { | ||
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { | ||
return sdkerrors.Wrap(err, "invalid authority address") | ||
} | ||
|
||
if err := m.Params.Validate(); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.