/
keys.go
43 lines (32 loc) · 1.19 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
package types
import "github.com/furychain/fury/utils"
// module constants
const (
// ModuleName defines the module name
ModuleName = "ovm"
// 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_ovm"
)
// store prefixes and keys.
var (
// KeyVaultKey is the key of the list of public keys in KV-Store which points to []string.
KeyVaultKey = []byte{0x00}
// ProposalStatsKey is the key for proposal statistics.
ProposalStatsKey = []byte{0x01}
// PubKeysChangeProposalListPrefix is the prefix of pubkeys change proposal.
PubKeysChangeProposalListPrefix = []byte{0x02}
)
// PubkeysChangeProposalPrefix returns prefix of the proposal list.
func PubkeysChangeProposalPrefix(status ProposalStatus) []byte {
return utils.Int32ToBytes(int32(status))
}
// PubkeysChangeProposalKey returns key of the proposal list.
func PubkeysChangeProposalKey(status ProposalStatus, id uint64) []byte {
return append(PubkeysChangeProposalPrefix(status), utils.Uint64ToBytes(id)...)
}