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 committed 2025-10-02 12:53:25 +01:00
1 parent 75353a0163
commit b3bf18f0ba
18 files changed
+51 -46

No files matched your search

+1 -1
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)