Commit 1493f08
committed
Merge #6690: feat(qt): add governance voting functionality to Qt wallet
cf4e9e6 fix: move CGovernanceVote inline methods to header for wallet linkage (pasta)
6f0723a chore: run clang-format (pasta)
2db939e fix: address PR review comments (pasta)
bd0f59e feat(governance): implement SignGovernanceVote method in CWallet for vote signing (pasta)
13b4117 feat(governance): refactor vote signing logic into a helper function (pasta)
778a0b1 feat(gui): add tooltip for masternode count display in governance tab (pasta)
81d6648 chore: apply clang-format (pasta)
edfe1ee refactor(governance): avoid recursion in wallet unlock handling (pasta)
24240a6 docs: add release notes for governance voting GUI feature (pasta)
0caee40 feat(gui): add masternode count display to governance tab (pasta)
5ac8475 feat(gui): add governance voting functionality to Qt wallet (pasta)
Pull request description:
## Issue being fixed or feature implemented
- Why is this change required? Currently, users must use CLI commands (gobject vote-many) to vote on governance proposals, which is not user-friendly for non-technical users who prefer the GUI wallet.
- What problem does it solve? This eliminates the need to use command-line tools for governance voting, making the voting process accessible to all GUI wallet users who own masternodes.
## What was done?
This PR adds complete governance voting functionality to the Qt wallet interface:
- Added right-click context menu to governance proposals table with "Vote Yes", "Vote No", and "Vote Abstain" options
- Implemented voting capability detection that checks if the wallet contains any masternode voting keys
- Added vote signing and submission logic that matches the existing RPC implementation (gobject vote-many)
- Implemented network-specific signing:
- Testnet: Uses SignSpecialTxPayload with vote.GetSignatureHash()
- Other networks: Uses SignMessage with vote.GetSignatureString()
- Extended interfaces:
- Added processVoteAndRelay method to the GOV interface (interfaces/node.h)
- Added signSpecialTxPayload method to the wallet interface (interfaces/wallet.h)
- Added comprehensive error handling with detailed feedback showing success/failure counts and specific error messages
- Implemented wallet unlock handling that prompts for passphrase when needed
- Updates vote counts in the governance list after voting
## How Has This Been Tested?
- Tested on testnet with multiple masternodes in wallet
- Verified voting capability detection correctly identifies wallets with/without voting keys
- Confirmed votes are successfully submitted and accepted by the network
- Tested wallet unlock flow with encrypted wallets
- Verified testnet-specific signing works correctly
- Confirmed vote counts update in the governance list after voting
Testing environment: macOS, testnet, wallet with 3 masternode voting keys
https://github.com/user-attachments/assets/de777bf7-2e05-4751-9e56-98e273703e66
## Breaking Changes
None - this PR only adds new functionality to the GUI without modifying existing behavior.
## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation (@thephez)
- [x] I have assigned this pull request to a milestone (for repository code-owners and collaborators only)
ACKs for top commit:
UdjinM6:
light ACK cf4e9e6
Tree-SHA512: aec92043e2432f66d071dccf91d127b91728d35e84ad1ca9fe88c1e15b5c2545a6730108833e7f19f2ef69ac5fdaf4d08288ce9ea0051d123f5a07f2c5f1c91cFile tree
14 files changed
+312
-43
lines changed- doc/release-notes
- src
- governance
- interfaces
- node
- qt
- forms
- rpc
- wallet
14 files changed
+312
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | 143 | | |
148 | 144 | | |
149 | 145 | | |
| |||
218 | 214 | | |
219 | 215 | | |
220 | 216 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | 217 | | |
229 | 218 | | |
230 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
| |||
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
116 | 127 | | |
117 | 128 | | |
118 | 129 | | |
| |||
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
129 | 145 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
143 | 158 | | |
144 | 159 | | |
145 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
76 | 112 | | |
77 | 113 | | |
78 | | - | |
| 114 | + | |
79 | 115 | | |
80 | 116 | | |
81 | 117 | | |
| |||
0 commit comments