-
Notifications
You must be signed in to change notification settings - Fork 38.7k
doc: Add RPC interface guidelines #10281
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
Conversation
kallewoof
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.
Nice.
doc/developer-notes.md
Outdated
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.
This is not the case right now. At the moment, 0 maps to false and !0 maps to true. See e.g. getrawtransaction's verbose argument handling.
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.
EH, I have that the wrong way around, thanks.
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.
Or not. What I meant here is:
false=0
true=1
E.g, the C++ mapping, not the bash mapping. As far as I know, we follow that everywhere?
If this wording is confusing, can you suggest another way.
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.
I read it as "interpret 0 as false and 1 as true, and anything else is [??]".
I.e. if a user passes 2 or -1 to the new RPC command which maps as you said, how will it treat values beyond [0, 1]?
Am I misunderstanding?
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.
I don't say anything about values besides 0 and 1 on purpose. Those may either map to 1, or to something else entirely (referring to "when bool has switched to multi-value"), or cause a failure.
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.
Ohh I was reading this backwards. You're talking about when a bool becomes an int, and I about when an int is interpreted as a bool. I'll think on wording to make this obvious.
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.
Re-reading this, I think I was simply not reading it properly. I think it looks fine as is.
doc/developer-notes.md
Outdated
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.
Thanks for this! I vaguely presumed this was the case but never found anything explicitly stating it.
|
Great addition. |
doc/developer-notes.md
Outdated
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.
nit: s/block chain/blockchain
32fd23f to
359f71d
Compare
|
Looks good. ACK 359f71d0fb243fa49884132c0fb0c24118d77842 |
|
ACK |
359f71d to
c26655e
Compare
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
Could be useful. Anything that I forgot?