File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed 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 @@ -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