-
Notifications
You must be signed in to change notification settings - Fork 2
/
msg_unfreeze_token.go
42 lines (34 loc) · 1.1 KB
/
msg_unfreeze_token.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 MsgUnfreezeToken struct {
Token string `json:"token"`
Issuer sdk.AccAddress `json:"issuer"`
}
func NewMsgUnfreezeToken(token string, issuer sdk.AccAddress) MsgUnfreezeToken {
return MsgUnfreezeToken{
Token: token,
Issuer: issuer,
}
}
// Route should return the name of the module
func (msg MsgUnfreezeToken) Route() string { return RouterKey }
// Type should return the action
func (msg MsgUnfreezeToken) Type() string { return "burn_token" }
// ValidateBasic runs stateless checks on the message
func (msg MsgUnfreezeToken) ValidateBasic() error {
return nil
}
// GetSigners defines whose signature is required
func (msg MsgUnfreezeToken) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{msg.Issuer}
}
// GetSignBytes encodes the message for signing
func (msg MsgUnfreezeToken) GetSignBytes() []byte {
ModuleCdc := codec.New()
ModuleCdc.RegisterConcrete(MsgUnfreezeToken{}, "issuer/MsgUnfreezeToken", nil)
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))
}