-
Notifications
You must be signed in to change notification settings - Fork 141
/
keys.go
57 lines (42 loc) · 1.35 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
52
53
54
55
56
57
package types
import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// ModuleName defines the module name
ModuleName = "btccheckpoint"
// 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
TStoreKey = "transient_btccheckpoint"
// MemStoreKey defines the in-memory store key
MemStoreKey = "mem_btccheckpoint"
LatestFinalizedEpochKey = "latestFinalizedEpoch"
btcLightClientUpdated = "btcLightClientUpdated"
)
var (
SubmisionKeyPrefix = []byte{3}
EpochDataPrefix = []byte{4}
LastFinalizedEpochKey = append([]byte{5}, []byte(LatestFinalizedEpochKey)...)
BtcLightClientUpdatedKey = append([]byte{6}, []byte(btcLightClientUpdated)...)
ParamsKey = []byte{7}
)
func KeyPrefix(p string) []byte {
return []byte(p)
}
func PrefixedSubmisionKey(cdc codec.BinaryCodec, k *SubmissionKey) []byte {
return append(SubmisionKeyPrefix, cdc.MustMarshal(k)...)
}
func GetEpochIndexKey(e uint64) []byte {
return append(EpochDataPrefix, sdk.Uint64ToBigEndian(e)...)
}
func GetLatestFinalizedEpochKey() []byte {
return LastFinalizedEpochKey
}
func GetBtcLightClientUpdatedKey() []byte {
return BtcLightClientUpdatedKey
}