Skip to content

doc: Add RPC interface guidelines - #10281

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
laanwj:2017_04_rpc_if_guidelines
May 2, 2017
Merged

laanwj merged 1 commit into
bitcoin:masterfrom
laanwj:2017_04_rpc_if_guidelines

Conversation

@laanwj

@laanwj laanwj commented Apr 26, 2017

Copy link
Copy Markdown
Member

Could be useful. Anything that I forgot?

@kallewoof kallewoof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Comment thread doc/developer-notes.md Outdated

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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.

@laanwj laanwj Apr 26, 2017 •

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Contributor

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?

@laanwj laanwj Apr 26, 2017 •

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

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.

Comment thread doc/developer-notes.md Outdated

Copy link
Copy Markdown
Contributor

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.

@jonasschnelli

Copy link
Copy Markdown
Contributor

Great addition.
Concept ACK.

Comment thread doc/developer-notes.md Outdated

Copy link
Copy Markdown
Member

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

@laanwj
laanwj force-pushed the 2017_04_rpc_if_guidelines branch from 32fd23f to 359f71d Compare April 26, 2017 06:49
@jnewbery

jnewbery commented May 1, 2017

Copy link
Copy Markdown
Contributor

Looks good. ACK 359f71d0fb243fa49884132c0fb0c24118d77842

@sipa

sipa commented May 1, 2017

Copy link
Copy Markdown
Member

ACK

@laanwj
laanwj force-pushed the 2017_04_rpc_if_guidelines branch from 359f71d to c26655e Compare May 2, 2017 05:52
@laanwj
laanwj merged commit c26655e into bitcoin:master May 2, 2017
laanwj added a commit that referenced this pull request May 2, 2017
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan)

Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 14, 2019
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan)

Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
@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

Development

Successfully merging this pull request may close these issues.

6 participants