HomePhabricator

RPC: access RPC arguments by name

Description

RPC: access RPC arguments by name

Summary:
Add arg helper unit test. Compare the results of self.Arg with the request.params accessors to ensure they behave the same way.

Overload the Arg and MaybeArg helpers to allow accessing arguments by name as well.

Also update the docs to document Arg and MaybeArg separately

Use the new key-based Arg helper in a few locations to show how it is used.

This is a backport of core#29277
Depends on D17946

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
stickies-v <stickies-v@protonmail.com>Authored on Sep 1 2023, 16:46
PiRKCommitted on Thu, Apr 17, 20:26
PiRKPushed on Thu, Apr 17, 20:26
Reviewer
Restricted Project
Differential Revision
D17947: RPC: access RPC arguments by name
Parents
rABC159c0dc33237: rpc, refactor: clean-up `addnode`
Branches
Unknown
Tags
Unknown