Skip to content

Make the public API docs more consistent and explicit#783

Merged
real-or-random merged 2 commits intobitcoin-core:masterfrom
elichai:2020-07-docs
Sep 15, 2021
Merged

Make the public API docs more consistent and explicit#783
real-or-random merged 2 commits intobitcoin-core:masterfrom
elichai:2020-07-docs

Conversation

@elichai
Copy link
Copy Markdown
Contributor

@elichai elichai commented Jul 30, 2020

I went over the public API and added missing explanations on when a pointer can be null and when it cannot,
and added some missing checks for null ctx and null pubkey pointers.

Open questions IMHO:

  1. Can secp256k1_context_create return NULL? right now it could return null if you replaced the callbacks at compile time to ones that do return(unlike the default ones which never return).
  2. Related to the first, should we document that the callbacks should never return? (in the tests we use returning callbacks but we can violate our own API) right now we say the following:

After this callback returns, anything may happen, including crashing.

Is this enough to document answer no for the first question and just saying that if the callback returned then you violated the API so secp256k1_context_create can return NULL even though it is promised not to?
Right now we AFAICT we never check if it returns null

Another nit I'm not sure about is wording (does nothing if NULL)/(ignored if NULL)/(can be NULL)

More missing docs:

  1. Documenting the data argument to the default nonce functions

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants