Commit ba25a5a
committed
DIP-0026: accept the multi-payout object as a JSON string (dash-cli)
ParsePayoutParam only recognized the {"address": basisPoints} payout form when it
arrived as a UniValue object, which is the case over JSON-RPC and named arguments.
dash-cli passes the payout argument as a plain string (it is not in the
rpc/client.cpp conversion table), so the documented object form sent via dash-cli
arrived as a string, fell through to the single-address branch, and failed with
"invalid payout address: {...}".
Accept the object whether it arrives as a UniValue object or as a JSON string: if a
string payout begins with '{', parse it and require a JSON object, otherwise treat it
as a single address. A base58/bech32 address never begins with '{', so the two forms
are unambiguous, and the legacy single-address CLI form is unchanged.
The functional test now sends one conversion's shares as a JSON string (the dash-cli
path) in addition to the dict form, so both arrival shapes are covered.1 parent 3cbef82 commit ba25a5a
2 files changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
414 | 433 | | |
415 | 434 | | |
416 | 435 | | |
| |||
423 | 442 | | |
424 | 443 | | |
425 | 444 | | |
426 | | - | |
| 445 | + | |
427 | 446 | | |
428 | 447 | | |
429 | 448 | | |
430 | 449 | | |
431 | | - | |
| 450 | + | |
432 | 451 | | |
433 | 452 | | |
434 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
307 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
308 | 316 | | |
309 | 317 | | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
313 | 321 | | |
314 | | - | |
| 322 | + | |
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
| |||
0 commit comments