aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-04-05 15:31:30 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-04-05 15:31:41 +0200
commit5c9b06db81091e1ebadf6e96701a5f1485a5d616 (patch)
tree52700e64bb2e41bfe25349f37412b74f53ab25e9 /src/rpc/util.h
parent824eea5643a1a317c04efcbd30268e46b9165a3c (diff)
parent5039e0e55a7c9dd63a38c12fa60d244592de69e0 (diff)
downloadbitcoin-5c9b06db81091e1ebadf6e96701a5f1485a5d616.tar.xz
Merge #21302: wallet: createwallet examples for descriptor wallets
5039e0e55a7c9dd63a38c12fa60d244592de69e0 test: HelpExampleCliNamed and HelpExampleRpcNamed (Ivan Metlushko) 591735ef0bf13b94643b794518406f981fa5dcb7 rpc: Add HelpExampleCliNamed and use it for `createwallet` doc (Wladimir J. van der Laan) 5d5a90e819d23a302f9bec6b995a3116ead6ae94 rpc: Add HelpExampleRpcNamed (Ivan Metlushko) Pull request description: Rationale: make descriptor wallets more visible and just a bit easier to setup `bitcoin-cli help createwallet` **Before**: ``` Examples: > bitcoin-cli createwallet "testwallet" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ ``` **After** ``` Examples: > bitcoin-cli createwallet "testwallet" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ > bitcoin-cli createwallet "descriptors" false false "" true true true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["descriptors", false, false, "", true, true, true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ ``` ACKs for top commit: laanwj: Tested ACK 5039e0e55a7c9dd63a38c12fa60d244592de69e0 Tree-SHA512: d37210e6ce639addee881377092d8f6fb2a537a60a259c561899e24cf68a0254d7ff45a213573c938f626677e46770cd21113aae5974f26c66b9a2e137699c14
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r--src/rpc/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h
index db7f626e9c..6e783e19fb 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -78,8 +78,12 @@ extern std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strNa
extern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey);
extern CAmount AmountFromValue(const UniValue& value);
+
+using RPCArgList = std::vector<std::pair<std::string, UniValue>>;
extern std::string HelpExampleCli(const std::string& methodname, const std::string& args);
+extern std::string HelpExampleCliNamed(const std::string& methodname, const RPCArgList& args);
extern std::string HelpExampleRpc(const std::string& methodname, const std::string& args);
+extern std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList& args);
CPubKey HexToPubKey(const std::string& hex_in);
CPubKey AddrToPubKey(const FillableSigningProvider& keystore, const std::string& addr_in);