-
Notifications
You must be signed in to change notification settings - Fork 339
/
keys.go
44 lines (33 loc) · 1.41 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
package types
import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// ModuleName is the name of the module
ModuleName = "bep3"
// StoreKey to be used when creating the KVStore
StoreKey = ModuleName
// RouterKey to be used for routing msgs
RouterKey = ModuleName
// QuerierRoute is the querier route for bep3
QuerierRoute = ModuleName
// DefaultParamspace default namestore
DefaultParamspace = ModuleName
// DefaultLongtermStorageDuration is 1 week (assuming a block time of 7 seconds)
DefaultLongtermStorageDuration uint64 = 86400
)
// Key prefixes
var (
// ModulePermissionsUpgradeTime is the block time after which the bep3 module account's permissions are synced with the supply module.
ModulePermissionsUpgradeTime time.Time = time.Date(2020, 11, 3, 10, 0, 0, 0, time.UTC)
AtomicSwapKeyPrefix = []byte{0x00} // prefix for keys that store AtomicSwaps
AtomicSwapByBlockPrefix = []byte{0x01} // prefix for keys of the AtomicSwapsByBlock index
AtomicSwapLongtermStoragePrefix = []byte{0x02} // prefix for keys of the AtomicSwapLongtermStorage index
AssetSupplyPrefix = []byte{0x03}
PreviousBlockTimeKey = []byte{0x04}
)
// GetAtomicSwapByHeightKey is used by the AtomicSwapByBlock index and AtomicSwapLongtermStorage index
func GetAtomicSwapByHeightKey(height uint64, swapID []byte) []byte {
return append(sdk.Uint64ToBigEndian(height), swapID...)
}