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

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke 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 Mf1812-rpcOptional branch 2 times, most recently from fa8aabb to fa4a5b4 Dec 5, 2018
@MarcoFalke
Copy link
Member Author

@MarcoFalke MarcoFalke 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
Copy link
Contributor

@DrahtBot DrahtBot 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 Mf1812-rpcOptional branch from fa4a5b4 to fa9a5bc Dec 10, 2018
MarcoFalke added a commit to MarcoFalke/bitcoin-core that referenced this issue Dec 18, 2018
…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
@MarcoFalke MarcoFalke deleted the Mf1812-rpcOptional branch Dec 18, 2018
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants