Rename Trie.prove to Trie.createProof#122
Conversation
tidy up typedoc
evertonfraga
left a comment
There was a problem hiding this comment.
This is a good step in a more semantic API.
I have compared the generated documentation with the former one, and it indeed not seem to require @method and empty @return annotations.
createProof documentation is also 👍 https://github.com/ethereumjs/merkle-patricia-tree/blob/rename-trie-prove/docs/classes/_basetrie_.trie.md#static-createproof
Approved :)
| - Upgrade ethereumjs-util to 7.0.0 / Upgrade level-mem to 5.0.1 ([#116](https://github.com/ethereumjs/merkle-patricia-tree/pull/116)) | ||
| - Create dual ES5 and ES2017 builds ([#117](https://github.com/ethereumjs/merkle-patricia-tree/pull/117)) | ||
| - Include checkpoints by default in SecureTrie.copy ([#119](https://github.com/ethereumjs/merkle-patricia-tree/pull/119)) | ||
| - Rename Trie.prove to Trie.createProof ([#122](https://github.com/ethereumjs/merkle-patricia-tree/pull/122)) |
| await trie.put(Buffer.from('test'), Buffer.from('one')) | ||
| const proof = await Trie.createProof(trie, Buffer.from('test')) | ||
| const value = await Trie.verifyProof(trie.root, Buffer.from('test'), proof) | ||
| console.log(value.toString()) // 'one' |
There was a problem hiding this comment.
Code example updated 👍
| * Commits a checkpoint to disk, if current checkpoint is not nested. If | ||
| * nested, only sets the parent checkpoint as current checkpoint. | ||
| * @method commit | ||
| * @returns {Promise} |
There was a problem hiding this comment.
On this particular function, the @return annotation is gone.
| proof = await CheckpointTrie.createProof(trie, Buffer.from('c')) | ||
| val = await CheckpointTrie.verifyProof(trie.root, Buffer.from('c'), proof) | ||
| t.equal(val!.toString('utf8'), 'c') | ||
|
|
| "readme": "none", | ||
| "gitRevision": "master", | ||
| "exclude": "src/**/!(secure|checkpointTrie|baseTrie).ts", | ||
| "exclude": ["src/**/!(secure|checkpointTrie|baseTrie).ts", "test/**/*.ts"], |
holgerd77
left a comment
There was a problem hiding this comment.
Yes, looks good to me as well, cool! 😄
@evertonfraga Please drop a note if you explicitly not wanted to give this an "official" approval yet.
|
@holgerd77 that was an official approval :) |
|
@evertonfraga ah, sorry, just saw the "Approved. :-)" comment. 😛 |
This PR:
provetocreateProofproveas a deprecated aliastype Proof = Buffer[]to improve param types forfromProof,createProof, andverifyProof.Fixes #120
This PR also tidies up and adds some missing doc comments. In particular
@memberof@methodand@returns {Promise}are automatically understood so they don't need to be explicitly defined (see Doc Comments syntax).