-
Notifications
You must be signed in to change notification settings - Fork 5
/
msg.go
36 lines (28 loc) · 999 Bytes
/
msg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package proposal
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
var (
_ sdk.Msg = &MsgUpdateParams{}
)
// Route implements the LegacyMsg interface.
func (m MsgUpdateParams) Route() string { return sdk.MsgTypeURL(&m) }
// Type implements the LegacyMsg interface.
func (m MsgUpdateParams) Type() string { return sdk.MsgTypeURL(&m) }
// GetSignBytes implements the LegacyMsg interface.
func (m MsgUpdateParams) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}
// ValidateBasic does a sanity check on the provided data.
func (m *MsgUpdateParams) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil {
return sdkerrors.Wrap(err, "authority")
}
return nil
}
// GetSigners returns the expected signers for MsgUpdateParams.
func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress {
addr, _ := sdk.AccAddressFromBech32(m.Authority)
return []sdk.AccAddress{addr}
}