forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin-core/secp256k1#783: Make the public API docs more consi…
…stent and explicit adec5a1 Add missing null check for ctx and input keys in the public API (Elichai Turkel) f4edfc7 Improve consistency for NULL arguments in the public interface (Elichai Turkel) Pull request description: 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 ACKs for top commit: ariard: ACK adec5a1 jonasnick: ACK adec5a1 Tree-SHA512: 6fe785776b7e451e9e8cae944987f927b1eb2e2d404dfcb1b0ceb0a30bda4ce16469708920269417e5ada09739723a430e270dea1868fe7d12ccd5699dde5976
- Loading branch information
Showing
8 changed files
with
125 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.