Repository navigation
doc: Add RPC interface guidelines - #10281
Conversation
There was a problem hiding this comment.
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.
EH, I have that the wrong way around, thanks.
There was a problem hiding this comment.
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.
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.
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.
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.
Re-reading this, I think I was simply not reading it properly. I think it looks fine as is.
There was a problem hiding this comment.
Thanks for this! I vaguely presumed this was the case but never found anything explicitly stating it.
|
Great addition. |
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?