File tree Expand file tree Collapse file tree 4 files changed +36
-29
lines changed
modal/testdata/Test_Snapshot Expand file tree Collapse file tree 4 files changed +36
-29
lines changed Original file line number Diff line number Diff line change 31
31
32
32
33
33
34
- ╭──Key Information────────────╮
35
- │ │
36
- │ Account: ABC │
37
- │ Participation ID: 123 │
38
- │ │
39
- │ Vote Key: VEVTVEtFWQ │
40
- │ Selection Key: VEVTVEtFWQ │
41
- │ State Proof Key: VEVTVEtFWQ │
42
- │ │
43
- │ Vote First Valid: 0 │
44
- │ Vote Last Valid: 30000 │
45
- │ Vote Key Dilution: 100 │
46
- │ │
47
- ╰──( (d)elete | (o)nline )────╯
34
+ ╭──Key Information──────────────╮
35
+ │ │
36
+ │ Account: ABC │
37
+ │ Participation ID: 123 │
38
+ │ │
39
+ │ Vote Key: VEVTVEtFWQ== │
40
+ │ Selection Key: VEVTVEtFWQ== │
41
+ │ State Proof Key: VEVTVEtFWQ== │
42
+ │ │
43
+ │ Vote First Valid: 0 │
44
+ │ Vote Last Valid: 30000 │
45
+ │ Vote Key Dilution: 100 │
46
+ │ │
47
+ ╰──── ( (d)elete | (o)nline )────╯
48
48
49
49
50
50
Original file line number Diff line number Diff line change @@ -92,9 +92,9 @@ func (m ViewModel) View() string {
92
92
}
93
93
account := style .Cyan .Render ("Account: " ) + m .Participation .Address
94
94
id := style .Cyan .Render ("Participation ID: " ) + m .Participation .Id
95
- selection := style .Yellow .Render ("Selection Key: " ) + * utils .UrlEncodeBytesPtrOrNil (m .Participation .Key .SelectionParticipationKey [:])
96
- vote := style .Yellow .Render ("Vote Key: " ) + * utils .UrlEncodeBytesPtrOrNil (m .Participation .Key .VoteParticipationKey [:])
97
- stateProof := style .Yellow .Render ("State Proof Key: " ) + * utils .UrlEncodeBytesPtrOrNil (* m .Participation .Key .StateProofKey )
95
+ selection := style .Yellow .Render ("Selection Key: " ) + * utils .Base64EncodeBytesPtrOrNil (m .Participation .Key .SelectionParticipationKey [:])
96
+ vote := style .Yellow .Render ("Vote Key: " ) + * utils .Base64EncodeBytesPtrOrNil (m .Participation .Key .VoteParticipationKey [:])
97
+ stateProof := style .Yellow .Render ("State Proof Key: " ) + * utils .Base64EncodeBytesPtrOrNil (* m .Participation .Key .StateProofKey )
98
98
voteFirstValid := style .Purple ("Vote First Valid: " ) + utils .IntToStr (m .Participation .Key .VoteFirstValid )
99
99
voteLastValid := style .Purple ("Vote Last Valid: " ) + utils .IntToStr (m .Participation .Key .VoteLastValid )
100
100
voteKeyDilution := style .Purple ("Vote Key Dilution: " ) + utils .IntToStr (m .Participation .Key .VoteKeyDilution )
Original file line number Diff line number Diff line change 1
-
2
- Account: ABC
3
- Participation ID: 123
4
-
5
- Vote Key: VEVTVEtFWQ
6
- Selection Key: VEVTVEtFWQ
7
- State Proof Key: VEVTVEtFWQ
8
-
9
- Vote First Valid: 0
10
- Vote Last Valid: 30000
11
- Vote Key Dilution: 100
12
-
1
+
2
+ Account: ABC
3
+ Participation ID: 123
4
+
5
+ Vote Key: VEVTVEtFWQ==
6
+ Selection Key: VEVTVEtFWQ==
7
+ State Proof Key: VEVTVEtFWQ==
8
+
9
+ Vote First Valid: 0
10
+ Vote Last Valid: 30000
11
+ Vote Key Dilution: 100
12
+
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ import (
7
7
8
8
func toPtr [T any ](constVar T ) * T { return & constVar }
9
9
10
+ func Base64EncodeBytesPtrOrNil (b []byte ) * string {
11
+ if b == nil || len (b ) == 0 || isZeros (b ) {
12
+ return nil
13
+ }
14
+ return toPtr (base64 .StdEncoding .EncodeToString (b ))
15
+ }
16
+
10
17
func UrlEncodeBytesPtrOrNil (b []byte ) * string {
11
18
if b == nil || len (b ) == 0 || isZeros (b ) {
12
19
return nil
You can’t perform that action at this time.
0 commit comments