-
Notifications
You must be signed in to change notification settings - Fork 236
/
keys.go
51 lines (39 loc) · 1.46 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
package types
const (
// ModuleName defines the module name
ModuleName = "cronos"
// StoreKey defines the primary module store key
StoreKey = ModuleName
// RouterKey is the message route for slashing
RouterKey = ModuleName
// QuerierRoute defines the module's query routing key
QuerierRoute = ModuleName
// MemStoreKey defines the in-memory store key
MemStoreKey = "mem_cronos"
// this line is used by starport scaffolding # ibc/keys/name
)
// prefix bytes for the cronos persistent store
const (
prefixDenomToExternalContract = iota + 1
prefixDenomToAutoContract
prefixContractToDenom
)
// KVStore key prefixes
var (
KeyPrefixDenomToExternalContract = []byte{prefixDenomToExternalContract}
KeyPrefixDenomToAutoContract = []byte{prefixDenomToAutoContract}
KeyPrefixContractToDenom = []byte{prefixContractToDenom}
)
// this line is used by starport scaffolding # ibc/keys/port
// DenomToExternalContractKey defines the store key for denom to contract mapping
func DenomToExternalContractKey(denom string) []byte {
return append(KeyPrefixDenomToExternalContract, denom...)
}
// DenomToAutoContractKey defines the store key for denom to auto contract mapping
func DenomToAutoContractKey(denom string) []byte {
return append(KeyPrefixDenomToAutoContract, denom...)
}
// ContractToDenomKey defines the store key for contract to denom reverse index
func ContractToDenomKey(contract []byte) []byte {
return append(KeyPrefixContractToDenom, contract...)
}