Skip to content

Commit 9c75bb8

Browse files
committed
trie: reverted Trie.setRoot() -> Trie._setRoot() rename from #125 in favor of deprecation
1 parent 761bef0 commit 9c75bb8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/trie/src/baseTrie.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,28 @@ export class Trie {
5858
this.db = db ? new DB(db) : new DB()
5959
this._root = this.EMPTY_TRIE_ROOT
6060
if (root) {
61-
this._setRoot(root)
61+
this.setRoot(root)
6262
}
6363
}
6464

6565
/** Sets the current root of the `trie` */
6666
set root(value: Buffer) {
67-
this._setRoot(value)
67+
this.setRoot(value)
6868
}
6969

7070
/** Gets the current root of the `trie` */
7171
get root(): Buffer {
7272
return this._root
7373
}
7474

75-
_setRoot(value?: Buffer) {
75+
/**
76+
* This method is deprecated.
77+
* Please use `Trie.root(value)` instead.
78+
*
79+
* @param value
80+
* @deprecated
81+
*/
82+
setRoot(value?: Buffer) {
7683
if (!value) {
7784
value = this.EMPTY_TRIE_ROOT
7885
}

0 commit comments

Comments
 (0)