-
Notifications
You must be signed in to change notification settings - Fork 2
/
msg_freeze_account.go
42 lines (34 loc) · 1.13 KB
/
msg_freeze_account.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
37
38
39
40
41
42
package types
import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Vote messages
type MsgFreezeAccount struct {
Account sdk.AccAddress `json:"account"`
Issuer sdk.AccAddress `json:"issuer"`
}
func NewMsgFreezeAccount(account sdk.AccAddress, issuer sdk.AccAddress) MsgFreezeAccount {
return MsgFreezeAccount{
Account: account,
Issuer: issuer,
}
}
// Route should return the name of the module
func (msg MsgFreezeAccount) Route() string { return RouterKey }
// Type should return the action
func (msg MsgFreezeAccount) Type() string { return "freeze_account" }
// ValidateBasic runs stateless checks on the message
func (msg MsgFreezeAccount) ValidateBasic() error {
return nil
}
// GetSigners defines whose signature is required
func (msg MsgFreezeAccount) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{msg.Issuer}
}
// GetSignBytes encodes the message for signing
func (msg MsgFreezeAccount) GetSignBytes() []byte {
ModuleCdc := codec.New()
ModuleCdc.RegisterConcrete(MsgFreezeAccount{}, "issuer/MsgFreezeAccount", nil)
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))
}