wallet: Make RPC help compile-time static
Summary:
Currently calling help on a wallet RPC method will either return help: unknown command: getnewaddress or the actual help. This runtime dependency of the help is a bug that complicates any tool that relies on documentation. Also, the code that enables the bug is overly complicated and confusing.
The fix is split into two commits:
- First, a commit that can be reviewed with the --color-moved=dimmed-zebra option and tested with the included test.
- Second, a commit that removes the complicated and confusing code.
This is a backport of core#19250 [1/2]
https://github.com/bitcoin/bitcoin/pull/19250/commits/fad889cbf0b6c46da2e110b73cbea55e4ff7951e
Depends on D9452
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D9455