/
keys.go
51 lines (40 loc) · 1.23 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
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
)
const (
// ModuleName defines the module name
ModuleName = "vesting"
// StoreKey defines the primary module store key
// Here use "vs" to avoid potential key collision with the ve module
StoreKey = "vs"
// RouterKey is the message route for slashing
RouterKey = ModuleName
// QuerierRoute defines the module's query routing key
QuerierRoute = ModuleName
)
const (
prefixAllocationAddress = iota + 1
prefixAirdropsTotalAmount
prefixAirdrops
prefixAirdropsCompleted
)
var (
KeyPrefixAllocationAddress = []byte{prefixAllocationAddress}
KeyPrefixAirdropsTotalAmount = []byte{prefixAirdropsTotalAmount}
KeyPrefixAirdrops = []byte{prefixAirdrops}
KeyPrefixAirdropsCompleted = []byte{prefixAirdropsCompleted}
)
func AllocationAddrKey() []byte {
return KeyPrefixAllocationAddress
}
func AirdropsTotalAmountKey() []byte {
return KeyPrefixAirdropsTotalAmount
}
func AirdropsKey(acc sdk.AccAddress) []byte {
return append(KeyPrefixAirdrops, address.MustLengthPrefix(acc)...)
}
func AirdropsCompletedKey(acc sdk.AccAddress) []byte {
return append(KeyPrefixAirdropsCompleted, address.MustLengthPrefix(acc)...)
}