-
Notifications
You must be signed in to change notification settings - Fork 127
/
keys.go
49 lines (38 loc) · 1.12 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
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// nolint
const (
// module name
ModuleName = "guardian"
// StoreKey is the default store key for guardian
StoreKey = ModuleName
// RouterKey is the message route for guardian
RouterKey = ModuleName
// QuerierRoute is the querier route for the guardian store.
QuerierRoute = StoreKey
// Query endpoints supported by the guardian querier
QueryProfilers = "profilers"
QueryTrustees = "trustees"
)
var (
ProfilerKey = []byte{0x00} // profiler key
TrusteeKey = []byte{0x01} // trustee key
)
// GetProfilerKey returns profiler key bytes
func GetProfilerKey(addr sdk.AccAddress) []byte {
return append(ProfilerKey, addr.Bytes()...)
}
// GetTrusteeKey returns trustee key bytes
func GetTrusteeKey(addr sdk.AccAddress) []byte {
return append(TrusteeKey, addr.Bytes()...)
}
// GetProfilersSubspaceKey returns the key for getting all profilers from the store
func GetProfilersSubspaceKey() []byte {
return ProfilerKey
}
// GetProfilersSubspaceKey returns the key for getting all profilers from the store
func GetTrusteesSubspaceKey() []byte {
return TrusteeKey
}