-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.go
73 lines (61 loc) · 1.38 KB
/
types.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package token
import (
sdk "github.com/irisnet/service-sdk-go/types"
)
const (
ModuleName = "token"
)
// GetSymbol implements exported.TokenI
func (t Token) GetSymbol() string {
return t.Symbol
}
// GetName implements exported.TokenI
func (t Token) GetName() string {
return t.Name
}
// GetScale implements exported.TokenI
func (t Token) GetScale() uint32 {
return t.Scale
}
// GetMinUnit implements exported.TokenI
func (t Token) GetMinUnit() string {
return t.MinUnit
}
// GetInitialSupply implements exported.TokenI
func (t Token) GetInitialSupply() uint64 {
return t.InitialSupply
}
// GetMaxSupply implements exported.TokenI
func (t Token) GetMaxSupply() uint64 {
return t.MaxSupply
}
// GetMintable implements exported.TokenI
func (t Token) GetMintable() bool {
return t.Mintable
}
// GetOwner implements exported.TokenI
func (t Token) GetOwner() sdk.AccAddress {
return t.Owner
}
func (t Token) Convert() interface{} {
return sdk.Token{
Symbol: t.Symbol,
Name: t.Name,
Scale: t.Scale,
MinUnit: t.MinUnit,
InitialSupply: t.InitialSupply,
MaxSupply: t.MaxSupply,
Mintable: t.Mintable,
Owner: t.Owner.String(),
}
}
type TokenInterface interface {
GetSymbol() string
GetName() string
GetScale() uint32
GetMinUnit() string
GetInitialSupply() uint64
GetMaxSupply() uint64
GetMintable() bool
GetOwner() sdk.AccAddress
}