From a965d442048ca854aaa2e5c409d685e1de508e02 Mon Sep 17 00:00:00 2001 From: Akio Nakamura Date: Thu, 16 May 2019 19:30:05 +0900 Subject: [PATCH] [RPC]Add assetlabel support to some commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remain the support of assetlabel parameter that was previously present. 1. sendtoaddress Print 'optional' explicitly in the help text.↲ 2. getreceivedbyaddress Add the 3rd parameter as "assetlabel" Print 'optional' explicitly in the help text.↲ 3. getreceivedbylabel Add the 3rd parameter as "assetlabel" Print 'optional' explicitly in the help text.↲ 4. getbalance Set the name of 4th parameter as "assetlabel". Print 'optional' explicitly in the help text.↲ 5. listreceivedbyaddress Set the name of 5th parameter as "assetlabel". Enable assetlabel selection to the result of amounts. Print 'optional' explicitly in the help text.↲ 6. gettransaction Add the 3rd parameter as "assetlabel" notice) Also getwalletinfo had a parameter to specify "assetlabel". But no need to add a parameter because the command is a catch-all one. --- src/wallet/rpcwallet.cpp | 28 +++++++++++-------- .../feature_confidential_transactions.py | 6 ++++ test/functional/wallet_labels.py | 3 ++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 166c4f8f6b4..287df405c40 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -609,7 +609,7 @@ static UniValue getreceivedbyaddress(const JSONRPCRequest& request) return NullUniValue; } - if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) + if (request.fHelp || request.params.size() < 1 || request.params.size() > 3) throw std::runtime_error( "getreceivedbyaddress \"address\" ( minconf )\n" "\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n" @@ -692,7 +692,7 @@ static UniValue getreceivedbylabel(const JSONRPCRequest& request) return NullUniValue; } - if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) + if (request.fHelp || request.params.size() < 1 || request.params.size() > 3) throw std::runtime_error( "getreceivedbylabel \"label\" ( minconf )\n" "\nReturns the total amount received by addresses with