Commit 44c8dda
committed
Merge #6720: test: implement helper functions for ProTx creation, allow working with
28aaf1d test: allow `assert_raises_rpc_error` with helper functions (Kittywhiskers Van Gogh)
5aeec2a test: validate that the 'submit' argument works as intended (Kittywhiskers Van Gogh)
43318a4 rpc: extend the ability to withhold submission to all ProTxes (Kittywhiskers Van Gogh)
968698b test: add helper for `update_service{,_evo}` calls (Kittywhiskers Van Gogh)
1493d67 test: add helper for `update_registrar{,_legacy}` calls (Kittywhiskers Van Gogh)
6ba685f test: add helper for `revoke` calls (Kittywhiskers Van Gogh)
aa96ace test: add helper for `register_fund{,_evo,_legacy}` calls (Kittywhiskers Van Gogh)
dbce9c9 test: add helper for `register{,_evo,_legacy}` calls (Kittywhiskers Van Gogh)
Pull request description:
## Motivation
Continuing on the work of [dash#6718](#6718), this pull request aims to do two things:
* Leverage the amount of information stored in `MasternodeInfo` to make ProTx creation simpler by only needing to specify the values that need to be _updated_ instead of needing to read most of the fields in `MasternodeInfo` to construct the RPC call
* This also comes with the bonus of `MasternodeInfo` knowing _which_ RPC call to make depending on whether the node is legacy regular, basic regular or basic evonode.
* As ordering is managed by `register{,_fund}`/`revoke`/`update_{registrar,service}()`, the arguments can be supplied in any desired order (or in RPC call order as the arguments have been arranged in that way except for `submit`, which is placed earlier and must be specified mandatorily).
* Allow testing both failure and success cases by introducing both support for `assert_raises_rpc_error` in these functions _and_ implementing support for withholding submission of a ProTx for non-ProRegTxes.
These changes benefit the functional tests needed for extended addresses, where we need to test for _changes_ in input validation logic based on deployment status, evaluating both success and failure cases. For instance, this pull request reduces the amount of logic in `Node` (in `rpc_netinfo.py`, introduced in [dash#6674](#6674)) by a fair amount ([diff](https://github.com/dashpay/dash/compare/c788531d35c48820af951799ff8b67ee2dadb8b3..232eb493484b5632b48320d6bbce6c459ee17602#diff-8bacb0d5b8909182c16ac6696c69f805c5cddc3deebc8eb4c0fac77b37aabd5d)) and could see further reduction in future iterations.
## Additional Information
* Depends on #6718
* Dependency for #6674
* As `fundsAddr` is an optional field in some ProTx RPCs that trigger different behavior if not supplied ([source](https://github.com/dashpay/dash/blob/ee34525451fbc3efffba6afadf812d2b7f5b7782/src/rpc/evo.cpp#L1237-L1246)), special handling has been introduced to make sure that if this behavior is desired, the argument itself is omitted as replacing it with a blank string does not trigger the intended behavior.
* This means that for `revoke()` and `update_registrar()`, transaction withholding (setting `submit` to `false`) is not allowed as this would require setting `fundsAddr` to an empty string, which does not trigger the expected fallback behavior.
* This does not extend to `update_service()` where a blank string is submitted as `protx update_service` does not seem to behave adversely when supplied a blank string.
* To test that the `submit` argument works as intended in newly updated and existing RPCs, if `submit` is `True` and no expected error code and message are supplied, at random, `submit` is set to `False` and the hex serialized signed transaction output is broadcast using `sendrawtransaction` (see `use_srd` variable).
## Breaking Changes
* A new optional field `submit` has been introduced to the `protx revoke`, `protx update_registrar`, `protx update_service` RPCs. It behaves identically to `submit` in `protx register` or `protx register_fund`.
## Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e tests
- [x] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
PastaPastaPasta:
utACK 28aaf1d
UdjinM6:
utACK 28aaf1d
Tree-SHA512: 2346c3ebcd9b4384a4884f0ad2e1f675fc23fc15575973109233770f006e1af98d3c22c0bbb819589a6f97e277a580e4f90b39d940fbe99f8a86961783d72e8eassert_raises_rpc_error, add ability to withhold submission to all ProTx creation RPCsFile tree
6 files changed
+338
-51
lines changed- doc
- src/rpc
- test/functional
- test_framework
6 files changed
+338
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
| 554 | + | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
| 593 | + | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | | - | |
| 900 | + | |
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| |||
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
| 918 | + | |
918 | 919 | | |
919 | | - | |
920 | | - | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
921 | 925 | | |
922 | 926 | | |
923 | 927 | | |
| |||
947 | 951 | | |
948 | 952 | | |
949 | 953 | | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
950 | 961 | | |
951 | | - | |
952 | | - | |
953 | 962 | | |
954 | 963 | | |
955 | 964 | | |
| |||
1055 | 1064 | | |
1056 | 1065 | | |
1057 | 1066 | | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1058 | 1072 | | |
1059 | 1073 | | |
1060 | 1074 | | |
1061 | 1075 | | |
1062 | 1076 | | |
1063 | 1077 | | |
1064 | 1078 | | |
1065 | | - | |
| 1079 | + | |
1066 | 1080 | | |
1067 | 1081 | | |
1068 | 1082 | | |
| |||
1083 | 1097 | | |
1084 | 1098 | | |
1085 | 1099 | | |
| 1100 | + | |
1086 | 1101 | | |
1087 | | - | |
1088 | | - | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1089 | 1107 | | |
1090 | 1108 | | |
1091 | 1109 | | |
| |||
1166 | 1184 | | |
1167 | 1185 | | |
1168 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1169 | 1192 | | |
1170 | 1193 | | |
1171 | 1194 | | |
1172 | 1195 | | |
1173 | | - | |
| 1196 | + | |
1174 | 1197 | | |
1175 | 1198 | | |
1176 | 1199 | | |
| |||
1198 | 1221 | | |
1199 | 1222 | | |
1200 | 1223 | | |
| 1224 | + | |
1201 | 1225 | | |
1202 | | - | |
1203 | | - | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1204 | 1231 | | |
1205 | 1232 | | |
1206 | 1233 | | |
| |||
1265 | 1292 | | |
1266 | 1293 | | |
1267 | 1294 | | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
1268 | 1300 | | |
1269 | 1301 | | |
1270 | 1302 | | |
1271 | | - | |
| 1303 | + | |
1272 | 1304 | | |
1273 | 1305 | | |
1274 | 1306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
| 241 | + | |
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
247 | | - | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
266 | | - | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | | - | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
282 | | - | |
| 283 | + | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 98 | + | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
116 | 114 | | |
117 | 115 | | |
118 | 116 | | |
119 | | - | |
| 117 | + | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
126 | | - | |
| 124 | + | |
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
| |||
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
135 | | - | |
| 133 | + | |
136 | 134 | | |
137 | | - | |
| 135 | + | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
0 commit comments