diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -49,10 +49,8 @@ " \"isscript\" : true|false, (boolean) If the key is a " "script\n" "}\n"}, - RPCExamples{HelpExampleCli("validateaddress", - "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + - HelpExampleRpc("validateaddress", - "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")}, + RPCExamples{HelpExampleCli("validateaddress", EXAMPLE_ADDRESS) + + HelpExampleRpc("validateaddress", EXAMPLE_ADDRESS)}, } .Check(request); diff --git a/src/rpc/util.h b/src/rpc/util.h --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -33,6 +33,11 @@ */ extern const std::string UNIX_EPOCH_TIME; +/** + * Example CashAddr address used in multiple RPCExamples. + */ +extern const std::string EXAMPLE_ADDRESS; + /** * Wrapper for UniValue::VType, which includes typeAny: used to denote don't * care type. diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -17,6 +17,8 @@ #include const std::string UNIX_EPOCH_TIME = "UNIX epoch time"; +const std::string EXAMPLE_ADDRESS = + "\"qrmzys48glkpevp2l4t24jtcltc9hyzx9cep2qffm4\""; void RPCTypeCheck(const UniValue ¶ms, const std::list &typesExpected, diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4117,9 +4117,6 @@ return NullUniValue; } - const std::string example_address = - "\"qrmzys48glkpevp2l4t24jtcltc9hyzx9cep2qffm4\""; - RPCHelpMan{ "getaddressinfo", "\nReturn information about the given bitcoin address.\n" @@ -4211,8 +4208,8 @@ " },...\n" " ]\n" "}\n"}, - RPCExamples{HelpExampleCli("getaddressinfo", example_address) + - HelpExampleRpc("getaddressinfo", example_address)}, + RPCExamples{HelpExampleCli("getaddressinfo", EXAMPLE_ADDRESS) + + HelpExampleRpc("getaddressinfo", EXAMPLE_ADDRESS)}, } .Check(request);