Skip to content

Use helper function to produce help text for params of protx rpcs#2649

Merged
codablock merged 6 commits into
dashpay:developfrom
UdjinM6:copypastehelp
Jan 29, 2019
Merged

Use helper function to produce help text for params of protx rpcs#2649
codablock merged 6 commits into
dashpay:developfrom
UdjinM6:copypastehelp

Conversation

@UdjinM6
Copy link
Copy Markdown

@UdjinM6 UdjinM6 commented Jan 25, 2019

It seems to be a bit confusing the way we organised help for register* rpcs because you have to run help twice - first time to see what params are expected (e.g. help protx register) and then to see what these params actually mean (help protx register_fund).

Changes:

  • Copy/paste help for various fields of register/register_prepare instead of referring to register_fund;
  • Adjust description of provided functionality and expected results.

Copy/paste help for various fields of `register`/`register_prepare` instead of referring to `register_fund`
Adjust description of provided functionality and expected results
@UdjinM6 UdjinM6 added this to the 14.0 milestone Jan 25, 2019
@PastaPastaPasta
Copy link
Copy Markdown
Member

Can we make this set of help output a variable so we don't have to edit it in three places in the future when it changes?

@UdjinM6 UdjinM6 changed the title Adjust help text of register* rpc commands Use helper function to produce help text for params of protx rpcs Jan 27, 2019
Copy link
Copy Markdown
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ack

Comment thread src/rpc/rpcevo.cpp
Comment thread src/rpc/rpcevo.cpp Outdated

std::string GetHelpString(int nParamNum, std::string strParamName)
{
std::map<std::string, std::string> mapParamHelp = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be static const as otherwise the whole map is initialized again and again.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Fixed in 5b5eb3a

Copy link
Copy Markdown

@codablock codablock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@codablock codablock merged commit 70a9e90 into dashpay:develop Jan 29, 2019
codablock pushed a commit to codablock/dash that referenced this pull request Feb 5, 2019
…ashpay#2649)

* Adjust help text of `register*` rpc commands

Copy/paste help for various fields of `register`/`register_prepare` instead of referring to `register_fund`
Adjust description of provided functionality and expected results

* Adjust whitespaces to match in different protx commands

* Add missing results descriptions

* Introduce new helper function GetHelpString to concentrate most of param descriptions in rpcevo in one place

* [MOVEONLY] Move GetHelpString out of #ifdef ENABLE_WALLET/#endif

* static const
@UdjinM6 UdjinM6 added the RPC Some notable changes to RPC params/behaviour/descriptions label Mar 5, 2019
@UdjinM6 UdjinM6 deleted the copypastehelp branch November 26, 2020 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC Some notable changes to RPC params/behaviour/descriptions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants