rpc: refactor: use string_view in Arg/MaybeArg

Modernizes interface by not forcing users to deal with raw pointers,
without adding copying overhead. Generalizes the logic of whether
we return by value or by optional/pointer.

In cases where functions take a `const std::string&` and it would
be too much work to update them, a string copy is made (which was
already happening anyway).
This commit is contained in:
stickies-v
2025-07-14 16:53:46 +01:00
parent 75353a0163
commit b3bf18f0ba
18 changed files with 51 additions and 46 deletions

View File

@@ -17,7 +17,7 @@ static std::string TestWalletName(const std::string& endpoint, std::optional<std
{
JSONRPCRequest req;
req.URI = endpoint;
return EnsureUniqueWalletName(req, parameter ? &*parameter : nullptr);
return EnsureUniqueWalletName(req, parameter);
}
BOOST_FIXTURE_TEST_SUITE(wallet_rpc_tests, BasicTestingSetup)