-
Notifications
You must be signed in to change notification settings - Fork 89
Conversation
tidy up typedoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)
@@ -50,6 +54,7 @@ See the [docs](https://github.com/ethereumjs/merkle-patricia-tree/tree/master/do | |||
- 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog entries. OK
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this particular function, the @return annotation is gone.
val = await CheckpointTrie.verifyProof(trie.root, Buffer.from('b'), proof) | ||
t.equal(val!.toString('utf8'), 'b') | ||
|
||
proof = await CheckpointTrie.prove(trie, Buffer.from('c')) | ||
proof = await CheckpointTrie.createProof(trie, Buffer.from('c')) | ||
val = await CheckpointTrie.verifyProof(trie.root, Buffer.from('c'), proof) | ||
t.equal(val!.toString('utf8'), 'c') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming in tests 👍
@@ -5,7 +5,7 @@ | |||
"plugin": "typedoc-plugin-markdown", | |||
"readme": "none", | |||
"gitRevision": "master", | |||
"exclude": "src/**/!(secure|checkpointTrie|baseTrie).ts", | |||
"exclude": ["src/**/!(secure|checkpointTrie|baseTrie).ts", "test/**/*.ts"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
prove
tocreateProof
prove
as 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
@method
and@returns {Promise}
are automatically understood so they don't need to be explicitly defined (see Doc Comments syntax).