HomePhabricator

rpc: adjust incorrect RPCHelpMan types

Description

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

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16243

Details

Provenance
Karl-Johan Alm <karljohan-alm@garage.co.jp>Authored on May 9 2021, 13:22
FabienCommitted on May 29 2024, 16:36
FabienPushed on May 29 2024, 16:36
Reviewer
Restricted Project
Differential Revision
D16243: rpc: adjust incorrect RPCHelpMan types
Parents
rABC1fd10c165008: RPC: Reject RPC requests with same named parameter specified multiple times
Branches
Unknown
Tags
Unknown