-
Notifications
You must be signed in to change notification settings - Fork 36
/
override.go
66 lines (63 loc) · 1.31 KB
/
override.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
package override
import (
"strings"
)
var typesModules = map[string]map[string]string{
"parasInclusion": {
"validatorindex": "ParaValidatorIndex",
},
"inclusion": {
"validatorindex": "ParaValidatorIndex",
},
"parasScheduler": {
"validatorindex": "ParaValidatorIndex",
},
"parasShared": {
"validatorindex": "ParaValidatorIndex",
},
"scheduler": {
"validatorindex": "ParaValidatorIndex",
},
"paraDisputes": {
"validatorindex": "ParaValidatorIndex",
},
"parasDisputes": {
"validatorindex": "ParaValidatorIndex",
},
"shared": {
"validatorindex": "ParaValidatorIndex",
},
"assets": {
"approval": "AssetApproval",
"approvalkey": "AssetApprovalKey",
"balance": "TAssetBalance",
"destroywitness": "AssetDestroyWitness",
},
"beefy": {
"authorityid": "BeefyId",
},
"ethereum": {
"block": "EthBlock",
"header": "EthHeader",
"receipt": "EthReceipt",
"transaction": "EthTransaction",
"transactionstatus": "EthTransactionStatus",
},
// sora
"bridgemultisig": {
"timepoint": "BridgeTimepoint",
},
}
func ModuleType(t, module string) string {
if module == "" {
return t
}
moduleTypes, ok := typesModules[strings.ToLower(module)]
if !ok {
return t
}
if overrideType, ok := moduleTypes[t]; ok {
return overrideType
}
return t
}