the type of childNodes is not comprehensive #342
Labels
audit 🔍
This issue is related to an audit.
good first issue
Good for newcomers
refactoring ♻️
A code change that neither fixes a bug nor adds a feature
zk-kit/packages/smt/src/smt.ts
Line 292 in de43718
here childNodes could be a leaf node of Entry type ([Key, Value, EntryMark]). However, the type system is defined as:
private nodes: Map<Node, ChildNodes>
export type ChildNodes = Node[]
export type Node = string | bigint
A more accurate system would be:
export type Node = string | bigint
export type InternalChildNodes = [Node, Node]
export type LeafChildNodes = [Key, Value, EntryMark]
export type ChildNodes = InternalChildNodes | LeafChildNodes
private nodes: Map<Node, ChildNodes>
The text was updated successfully, but these errors were encountered: