/
const.go
91 lines (82 loc) · 2.75 KB
/
const.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package types
//key
var (
ProphecyKey = []byte("prefix_for_Prophecy")
Eth2Chain33Key = []byte("prefix_for_Eth2Chain33")
WithdrawEthKey = []byte("prefix_for_WithdrawEth")
Chain33ToEthKey = []byte("prefix_for_Chain33ToEth")
WithdrawChain33Key = []byte("prefix_for_WithdrawChain33")
LastTotalPowerKey = []byte("prefix_for_LastTotalPower")
ValidatorMapsKey = []byte("prefix_for_ValidatorMaps")
ConsensusThresholdKey = []byte("prefix_for_ConsensusThreshold")
TokenSymbolTotalLockOrBurnAmountKey = []byte("prefix_for_TokenSymbolTotalLockOrBurnAmount-")
TokenSymbolToTokenAddressKey = []byte("prefix_for_TokenSymbolToTokenAddress-")
)
// log for x2ethereum
// log类型id值
const (
TyUnknownLog = iota + 100
TyEth2Chain33Log
TyWithdrawEthLog
TyWithdrawChain33Log
TyChain33ToEthLog
TyAddValidatorLog
TyRemoveValidatorLog
TyModifyPowerLog
TySetConsensusThresholdLog
TyProphecyLog
TyTransferLog
TyTransferToExecLog
TyWithdrawFromExecLog
)
// action类型id和name,这些常量可以自定义修改
const (
TyUnknowAction = iota + 100
TyEth2Chain33Action
TyWithdrawEthAction
TyWithdrawChain33Action
TyChain33ToEthAction
TyAddValidatorAction
TyRemoveValidatorAction
TyModifyPowerAction
TySetConsensusThresholdAction
TyTransferAction
TyTransferToExecAction
TyWithdrawFromExecAction
NameEth2Chain33Action = "Eth2Chain33Lock"
NameWithdrawEthAction = "Eth2Chain33Burn"
NameWithdrawChain33Action = "Chain33ToEthBurn"
NameChain33ToEthAction = "Chain33ToEthLock"
NameAddValidatorAction = "AddValidator"
NameRemoveValidatorAction = "RemoveValidator"
NameModifyPowerAction = "ModifyPower"
NameSetConsensusThresholdAction = "SetConsensusThreshold"
NameTransferAction = "Transfer"
NameTransferToExecAction = "TransferToExec"
NameWithdrawFromExecAction = "WithdrawFromExec"
)
//DefaultConsensusNeeded ...
const DefaultConsensusNeeded = int64(70)
//direct ...
const (
DirEth2Chain33 = "eth2chain33"
DirChain33ToEth = "chain33toeth"
LockClaim = "lock"
BurnClaim = "burn"
)
//DirectionType type
var DirectionType = [3]string{"", DirEth2Chain33, DirChain33ToEth}
// query function name
const (
FuncQueryEthProphecy = "GetEthProphecy"
FuncQueryValidators = "GetValidators"
FuncQueryTotalPower = "GetTotalPower"
FuncQueryConsensusThreshold = "GetConsensusThreshold"
FuncQuerySymbolTotalAmountByTxType = "GetSymbolTotalAmountByTxType"
FuncQueryRelayerBalance = "GetRelayerBalance"
)
//lock type
const (
LockClaimType = int32(1)
BurnClaimType = int32(2)
)