This concludes backport of [[https://github.com/bitcoin/bitcoin/pull/19717 | core#19717]] [4/4]
https://github.com/bitcoin/bitcoin/pull/19717/commits/fa3d9ce3254882c545d700990fe8e9a678f31eed
Depends on D10147, D10149 and D10159
Note: the forward declaration of RPC functions in rpcwallet.cpp don't seem to exist in Bitcoin ABC, and the ones in wallet_tests.cpp were in rpcdump.h (see D45)