forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 725
[RPC] getnewshieldaddress add 'label' argument #2600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
furszy
merged 1 commit into
PIVX-Project:master
from
furszy:2021_getnewshieldaddr_add_label
Oct 19, 2021
Merged
[RPC] getnewshieldaddress add 'label' argument #2600
furszy
merged 1 commit into
PIVX-Project:master
from
furszy:2021_getnewshieldaddr_add_label
Oct 19, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Index: src/wallet/rpcwallet.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
--- a/src/wallet/rpcwallet.cpp (revision c1056fd213d7162404c008b240a193d7d9b781f2)
+++ b/src/wallet/rpcwallet.cpp (date 1634195580801)
@@ -555,7 +555,7 @@
if (!EnsureWalletIsAvailable(pwallet, request.fHelp))
return NullUniValue;
- if (request.fHelp || !request.params.empty())
+ if (request.fHelp || request.params.size() > 1)
throw std::runtime_error(
"getnewshieldaddress ( \"label\" )\n"
"\nReturns a new shield address for receiving payments.\n"
@@ -575,8 +575,8 @@
);
std::string label;
- if (!params.isNull() && params.size() > 0) {
- label = LabelFromValue(params[0]);
+ if (!request.params.empty()) {
+ label = LabelFromValue(request.params[0]);
}
LOCK2(cs_main, pwallet->cs_wallet); |
|
Also, we need to support named args for the RPC now Index: src/wallet/rpcwallet.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
--- a/src/wallet/rpcwallet.cpp (revision c1056fd213d7162404c008b240a193d7d9b781f2)
+++ b/src/wallet/rpcwallet.cpp (date 1634214619918)
@@ -4787,7 +4787,7 @@
{ "wallet", "bip38decrypt", &bip38decrypt, true, {"encrypted_key","passphrase"} },
/** Sapling functions */
- { "wallet", "getnewshieldaddress", &getnewshieldaddress, true, {} },
+ { "wallet", "getnewshieldaddress", &getnewshieldaddress, true, {"label"} },
{ "wallet", "listshieldaddresses", &listshieldaddresses, false, {"include_watchonly"} },
{ "wallet", "exportsaplingkey", &exportsaplingkey, true, {"shield_addr"} },
{ "wallet", "importsaplingkey", &importsaplingkey, true, {"key","rescan","height"} }, |
c1056fd to
5718ad8
Compare
random-zebra
approved these changes
Oct 15, 2021
random-zebra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5718ad8
Fuzzbawls
approved these changes
Oct 19, 2021
Collaborator
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5718ad8
furszy
added a commit
that referenced
this pull request
Nov 19, 2021
db68b90 [RPC] Shield address setlabel/getaddressesbylabel (Fuzzbawls) Pull request description: This adds shield address support to the `setlabel` and `getaddressesbylabel` RPC commands. `setlabel` now accepts and validates shield address input argument, where `getaddressesbylabel` now returns shield addresses with a label matching the input argument. Companion to #2600 that allows CLI users to set a label for shield addresses after-the-fact, as well as see shield addresses with an assigned label in the response of `getaddressesbylabel` Also added relevant release notes for the changes in #2600. Regression tests added as well to cover the `setlabel` command. ACKs for top commit: random-zebra: ACK db68b90 furszy: code ACK db68b90, merging.. Tree-SHA512: 3344849a612c36eddd00ff30110b7cf48b044976dc1312c8b2769c8df33d8ffd971e5a4142424cbaabd90ea8632b4c9da83a001f90cce044b487a477fe8870c2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Straightforward, implements #2599 functionality.