Skip to content
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

RPCHelpMan: Support required arguments after optional ones #14875

Merged
merged 1 commit into from Dec 18, 2018

Conversation

Projects
None yet
2 participants
@MarcoFalke
Copy link
Member

commented Dec 5, 2018

There was a requirement that required arguments could not be positioned after an optional argument, but the deprecation of priority made the second argument to prioritisetransaction optional. So support that in RPCHelpMan.

Also format all named arguments in the same way (without the wrapping " even for strings), since the extended description already mentions the type and it feels odd to special case strings.

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Dec 5, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1812-rpcOptional branch 2 times, most recently Dec 5, 2018

@MarcoFalke

This comment has been minimized.

Copy link
Member Author

commented Dec 5, 2018

Example diff:
-prioritisetransaction "txid" dummy fee_delta
+prioritisetransaction "txid" ( dummy ) fee_delta
 Accepts the transaction into mined blocks at a higher (or lower) priority
 
 Arguments:
-1. "txid"       (string, required) The transaction id.
-2. dummy        (numeric, required) API-Compatibility for previous API. Must be zero or null.
+1. txid         (string, required) The transaction id.
+2. dummy        (numeric, optional, default=null) API-Compatibility for previous API. Must be zero or null.
                 DEPRECATED. For forward compatibility use named arguments and omit this parameter.
 3. fee_delta    (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).
                 Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.
@DrahtBot

This comment has been minimized.

Copy link
Contributor

commented Dec 6, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #14885 (rpc: Assert named arguments are unique in RPCHelpMan by promag)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1812-rpcOptional branch to fa9a5bc Dec 10, 2018

MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Dec 18, 2018

Merge bitcoin#14875: RPCHelpMan: Support required arguments after opt…
…ional ones

fa9a5bc RPCHelpMan: Support required arguments after optional ones (MarcoFalke)

Pull request description:

  There was a requirement that required arguments could not be positioned after an optional argument, but the deprecation of priority made the second argument to `prioritisetransaction` optional. So support that in `RPCHelpMan`.

  Also format all named arguments in the same way (without the wrapping `"` even for strings), since the extended description already mentions the type and it feels odd to special case strings.

Tree-SHA512: c125145afb4a63abc995aaf0a89489efc0f470a720727a1ca6ee0bfd2bcbc59e87c38128dd1e0cdf03dbb5b18e84867887c3dabf6ec8378e66cb1f4cecb9e407

@MarcoFalke MarcoFalke merged commit fa9a5bc into bitcoin:master Dec 18, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MarcoFalke MarcoFalke deleted the MarcoFalke:Mf1812-rpcOptional branch Dec 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.