-
Notifications
You must be signed in to change notification settings - Fork 42
/
keys.go
46 lines (35 loc) · 1.06 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
package types
const (
// ModuleName defines the module name
ModuleName = "cheqd"
// 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
DidMethod = ModuleName
)
// State:
// did-namespace: -> <did-namespace>
// did-count: -> <did-count>
// did-latest:<did> -> <latest-version>
// did-version:<did>:<version> -> <did-doc>
const (
LatestDidDocVersionKey = "did-latest:"
DidDocVersionKey = "did-version:"
DidDocCountKey = "did-count:"
DidNamespaceKey = "did-namespace:"
)
func GetLatestDidDocVersionKey(did string) []byte {
return []byte(LatestDidDocVersionKey + did)
}
func GetDidDocVersionKey(did string, version string) []byte {
return []byte(DidDocVersionKey + did + ":" + version)
}
func GetLatestDidDocVersionPrefix() []byte {
return []byte(LatestDidDocVersionKey)
}
func GetDidDocVersionsPrefix(did string) []byte {
return []byte(DidDocVersionKey + did + ":")
}