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
Fix documentations of rpc listsinceblock
#8758
Comments
Agree, though I don't think the parameter should even be called target-confirmations if that is what it does. |
listsinceblock
listsinceblock
listsinceblock
listsinceblock
I updated the issue to include 2 other minor documentation issues for the same rpc call, as it probably should all be done as one thing. |
I don't think this should be closed, #9396 only fixed 1 out of the three issues in the docs. |
Another issue with listsinceblock documentation, is that it's missing documentation for |
There's also missing documentation for the field |
Line 280 in 7a74f88
|
That's not exposed to end users when they via the listsinceblock help/docs :D |
The alternative is to use a "special value", which is fraught with more risk. E.g. the return value -1 for "no data" in |
@RHavar errors are always hard to discover if they're not documented correctly and even then; hiding the fields is about shaping how the caller fails when they get it wrong. I think our coding standards should reflect something like: "Avoid returning special values for error conditions, especially for gauge outputs (like numbers of connections, btc amounts, etc.) because the error code can be mistaken for a value even if the error is negative and negative results don't make much sense. For fields which are naturally categorical an in-band error can be more acceptable e.g. something that returns "apple" / "grape" / "cherry" could also return "error", but is generally preferable to have a named result field and not return it when there is an error, and return an error field instead." It's always sad if you mishandle an error-- but I'd rather the caller fail cleanly rather than average a -1 into some data or something like that. |
1 similar comment
@RHavar errors are always hard to discover if they're not documented correctly and even then; hiding the fields is about shaping how the caller fails when they get it wrong. I think our coding standards should reflect something like: "Avoid returning special values for error conditions, especially for gauge outputs (like numbers of connections, btc amounts, etc.) because the error code can be mistaken for a value even if the error is negative and negative results don't make much sense. For fields which are naturally categorical an in-band error can be more acceptable e.g. something that returns "apple" / "grape" / "cherry" could also return "error", but is generally preferable to have a named result field and not return it when there is an error, and return an error field instead." It's always sad if you mishandle an error-- but I'd rather the caller fail cleanly rather than average a -1 into some data or something like that. |
I believe this issue can be closed. The fields |
The second param of listsinceblock
From issue 8752
From the actual docs here is it is:
However, that's misleading at best. I've seen at least one project thinking that
target-confirmations
means "filter to only show transactions of n target-confirmations". It's a weird param but I'd document it asTransactions confirmations
Says:
It should also say when it's < 0, it means the transaction conflicted that many blocks ago
bip125-replaceable
There's an undocumented field of transactions "bip125-replaceable" which I believe has three possibilities "yes" "no" and "unknown" (under what circumstances it says unknown, should also be documented)
The text was updated successfully, but these errors were encountered: