-
Notifications
You must be signed in to change notification settings - Fork 5
/
edit_token.go
43 lines (35 loc) · 848 Bytes
/
edit_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
43
package token
import (
"fmt"
. "github.com/kaifei-bianjie/msg-parser/modules"
)
type DocMsgEditToken struct {
Symbol string `bson:"symbol"`
Name string `bson:"name"`
MaxSupply string `bson:"max_supply"`
Mintable bool `bson:"mintable"`
Owner string `bson:"owner"`
}
func (m *DocMsgEditToken) GetType() string {
return MsgTypeEditToken
}
func (m *DocMsgEditToken) BuildMsg(v interface{}) {
msg := v.(*MsgEditToken)
m.Symbol = msg.Symbol
m.Owner = msg.Owner
m.Name = msg.Name
m.MaxSupply = fmt.Sprint(msg.MaxSupply)
m.Mintable = msg.Mintable.ToBool()
}
func (m *DocMsgEditToken) HandleTxMsg(v SdkMsg) MsgDocInfo {
var (
addrs []string
msg MsgEditToken
)
ConvertMsg(v, &msg)
addrs = append(addrs, msg.Owner)
handler := func() (Msg, []string) {
return m, addrs
}
return CreateMsgDocInfo(v, handler)
}