-
Notifications
You must be signed in to change notification settings - Fork 28
/
keys.go
40 lines (32 loc) · 894 Bytes
/
keys.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
package types
import (
"github.com/cosmos/cosmos-sdk/codec"
gogotypes "github.com/cosmos/gogoproto/types"
)
const (
ModuleName = "onft"
StoreKey = ModuleName
RouterKey = ModuleName
)
var (
PrefixONFT = []byte{0x01}
PrefixOwners = []byte{0x02}
PrefixCollection = []byte{0x03}
PrefixDenom = []byte{0x04}
ParamsKey = []byte{0x07}
)
func MustUnMarshalSupply(cdc codec.BinaryCodec, value []byte) uint64 {
var supplyWrap gogotypes.UInt64Value
cdc.MustUnmarshal(value, &supplyWrap)
return supplyWrap.Value
}
func MustUnMarshalONFTID(cdc codec.BinaryCodec, value []byte) string {
var onftIDWrap gogotypes.StringValue
cdc.MustUnmarshal(value, &onftIDWrap)
return onftIDWrap.Value
}
func MustUnMarshalDenomID(cdc codec.BinaryCodec, value []byte) string {
var denomIDWrap gogotypes.StringValue
cdc.MustUnmarshal(value, &denomIDWrap)
return denomIDWrap.Value
}