Page MenuHomePhabricator

rpc: adjust incorrect RPCHelpMan types
ClosedPublic

Authored by Fabien on May 29 2024, 13:11.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC5cbb2dbe0473: rpc: adjust incorrect RPCHelpMan types
Summary
This PR adjusts the two issues I encountered while developing a tool that converts RPCHelpMan objects into bindings for other language(s).

The first is in createrawtransaction, where the address part, e.g. bc1qabc in

    createrawtransaction '[]' '[{"bc1qabc": 1.0}]'

is declared as a Type::OBJ, when in reality it should be a Type::OBJ_USER_KEYS, defined as such:

bitcoin/src/rpc/util.h

Line 126 in 5925f1e
 OBJ_USER_KEYS, //!< Special type where the user must set the keys e.g. to define multiple addresses; as opposed to e.g. an options object where the keys are predefined

(coincidentally, this is the first and only (afaict) usage of this RPCArg::Type).

The second is in the listaddressgroupings RPC, which returns an array of arrays of arrays, where the innermost one is a tuple-thingie with an optional 3rd item; this is an ARR_FIXED, not an ARR.

Backport of core#21897.

Test Plan
ninja all check-all

Event Timeline

Fabien requested review of this revision.May 29 2024, 13:11
This revision is now accepted and ready to land.May 29 2024, 13:44

Tail of the build log:

wallet_multiwallet.py --usecli             | ✓ Passed  | 21 s
wallet_reorgsrestore.py                    | ✓ Passed  | 7 s
wallet_resendwallettransactions.py         | ✓ Passed  | 3 s
wallet_send.py                             | ✓ Passed  | 13 s
wallet_startup.py                          | ✓ Passed  | 6 s
wallet_timelock.py                         | ✓ Passed  | 2 s
wallet_txn_clone.py                        | ✓ Passed  | 4 s
wallet_txn_clone.py --mineblock            | ✓ Passed  | 4 s
wallet_txn_doublespend.py                  | ✓ Passed  | 3 s
wallet_txn_doublespend.py --mineblock      | ✓ Passed  | 4 s
wallet_watchonly.py                        | ✓ Passed  | 3 s
wallet_watchonly.py --usecli               | ✓ Passed  | 3 s
chronik_avalanche.py                       | ○ Skipped | 0 s
chronik_block.py                           | ○ Skipped | 0 s
chronik_block_info.py                      | ○ Skipped | 0 s
chronik_block_txs.py                       | ○ Skipped | 0 s
chronik_blockchain_info.py                 | ○ Skipped | 0 s
chronik_blocks.py                          | ○ Skipped | 0 s
chronik_chronik_info.py                    | ○ Skipped | 0 s
chronik_cors.py                            | ○ Skipped | 0 s
chronik_disable_token_index.py             | ○ Skipped | 0 s
chronik_disallow_prune.py                  | ○ Skipped | 0 s
chronik_lokad_id_group.py                  | ○ Skipped | 0 s
chronik_mempool_conflicts.py               | ○ Skipped | 0 s
chronik_pause.py                           | ○ Skipped | 0 s
chronik_plugins_setup.py                   | ○ Skipped | 0 s
chronik_raw_tx.py                          | ○ Skipped | 0 s
chronik_resync.py                          | ○ Skipped | 0 s
chronik_script_confirmed_txs.py            | ○ Skipped | 0 s
chronik_script_history.py                  | ○ Skipped | 0 s
chronik_script_unconfirmed_txs.py          | ○ Skipped | 0 s
chronik_script_utxos.py                    | ○ Skipped | 0 s
chronik_serve.py                           | ○ Skipped | 0 s
chronik_spent_by.py                        | ○ Skipped | 0 s
chronik_token_alp.py                       | ○ Skipped | 0 s
chronik_token_broadcast_txs.py             | ○ Skipped | 0 s
chronik_token_burn.py                      | ○ Skipped | 0 s
chronik_token_id_group.py                  | ○ Skipped | 0 s
chronik_token_parse_failure.py             | ○ Skipped | 0 s
chronik_token_script_group.py              | ○ Skipped | 0 s
chronik_token_slp_fungible.py              | ○ Skipped | 0 s
chronik_token_slp_mint_vault.py            | ○ Skipped | 0 s
chronik_token_slp_nft1.py                  | ○ Skipped | 0 s
chronik_tx.py                              | ○ Skipped | 0 s
chronik_tx_removal_order.py                | ○ Skipped | 0 s
chronik_ws.py                              | ○ Skipped | 0 s
chronik_ws_ordering.py                     | ○ Skipped | 0 s
chronik_ws_ping.py                         | ○ Skipped | 0 s
chronik_ws_script.py                       | ○ Skipped | 0 s
feature_bind_port_discover.py              | ○ Skipped | 0 s
feature_bind_port_externalip.py            | ○ Skipped | 0 s
interface_usdt_net.py                      | ○ Skipped | 0 s
interface_usdt_utxocache.py                | ○ Skipped | 0 s
interface_usdt_validation.py               | ○ Skipped | 0 s

ALL                                        | ✓ Passed  | 1930 s (accumulated) 
Runtime: 386 s

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
This revision was landed with ongoing or failed builds.May 29 2024, 16:36
This revision was automatically updated to reflect the committed changes.