-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
utils.go
44 lines (41 loc) · 1.03 KB
/
utils.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 utils
// NormalizeVoteOption - normalize user specified vote option
func NormalizeVoteOption(option string) string {
switch option {
case "Yes", "yes":
return "Yes"
case "Abstain", "abstain":
return "Abstain"
case "No", "no":
return "No"
case "NoWithVeto", "no_with_veto":
return "NoWithVeto"
}
return ""
}
//NormalizeProposalType - normalize user specified proposal type
func NormalizeProposalType(proposalType string) string {
switch proposalType {
case "Text", "text":
return "Text"
case "ParameterChange", "parameter_change":
return "ParameterChange"
case "SoftwareUpgrade", "software_upgrade":
return "SoftwareUpgrade"
}
return ""
}
//NormalizeProposalStatus - normalize user specified proposal status
func NormalizeProposalStatus(status string) string {
switch status {
case "DepositPeriod", "deposit_period":
return "DepositPeriod"
case "VotingPeriod", "voting_period":
return "VotingPeriod"
case "Passed", "passed":
return "Passed"
case "Rejected", "rejected":
return "Rejected"
}
return ""
}