HomePhabricator

rpc: Check that left section is not multiline

Description

rpc: Check that left section is not multiline

Summary:
PR description:

Motivation

RPCArg names in the rpc help are currently only used for documentation. However, in the future they could be used to teach the server the named arguments. Named arguments are currently registered by the CRPCCommands and duplicate the RPCArg names from the documentation. This redundancy is fragile, and has lead to errors in the past (despite having linters to catch those kind of errors).

Changes

The changes here add an assert in the CRPCCommand constructor that the RPCArg names are identical to the ones in the CRPCCommand.

This is a backport of core#19386 [1/5]
https://github.com/bitcoin/bitcoin/pull/19386/commits/fa8ec00061567e56333bb69c5623919d45a9a92d

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 17 2020, 17:28
PiRKCommitted on Sep 1 2021, 13:59
PiRKPushed on Sep 1 2021, 13:59
Reviewer
Restricted Project
Differential Revision
D10006: rpc: Check that left section is not multiline
Parents
rABC4d6e8910627b: [Cashtab] Add props validation and clean up resulting lint errors
Branches
Unknown
Tags
Unknown