diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index b9b1dd992..653bec0fa 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -26,12 +26,13 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.19 + cache: false # the golangci-lint action already caches for us (https://github.com/golangci/golangci-lint-action#performance) - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.52.1 + version: v1.54.2 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/x/sudo/types/msgs.go b/x/sudo/types/msgs.go index dc3cf81f4..ea11fcfd4 100644 --- a/x/sudo/types/msgs.go +++ b/x/sudo/types/msgs.go @@ -6,11 +6,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -var _ sdk.Msg = &MsgEditSudoers{} +var ( + _ sdk.Msg = &MsgEditSudoers{} + _ sdk.Msg = &MsgChangeRoot{} +) // MsgEditSudoers -func (m *MsgEditSudoers) ValidateBasic() error { +func (m MsgEditSudoers) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Sender); err != nil { return err } @@ -31,7 +34,7 @@ func (m *MsgEditSudoers) ValidateBasic() error { return nil } -func (m *MsgEditSudoers) GetSigners() []sdk.AccAddress { +func (m MsgEditSudoers) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { panic(err) @@ -39,13 +42,24 @@ func (m *MsgEditSudoers) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -func (m *MsgEditSudoers) RootAction() RootAction { +// Route Implements Msg. +func (msg MsgEditSudoers) Route() string { return ModuleName } + +// Type Implements Msg. +func (msg MsgEditSudoers) Type() string { return "edit_sudoers" } + +// GetSignBytes Implements Msg. +func (m MsgEditSudoers) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgEditSudoers) RootAction() RootAction { return RootAction(m.Action) } // MsgChangeRoot -func (m *MsgChangeRoot) GetSigners() []sdk.AccAddress { +func (m MsgChangeRoot) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { panic(err) @@ -53,7 +67,7 @@ func (m *MsgChangeRoot) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -func (m *MsgChangeRoot) ValidateBasic() error { +func (m MsgChangeRoot) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Sender); err != nil { return err } @@ -64,3 +78,14 @@ func (m *MsgChangeRoot) ValidateBasic() error { return nil } + +// Route Implements Msg. +func (msg MsgChangeRoot) Route() string { return ModuleName } + +// Type Implements Msg. +func (msg MsgChangeRoot) Type() string { return "change_root" } + +// GetSignBytes Implements Msg. +func (m MsgChangeRoot) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +}