Skip to content

Commit

Permalink
Add back options
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Jun 14, 2024
1 parent 74b04ed commit 0f9b3f3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion trie_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ type TrieSpec struct {
}

// NewTrieSpec returns a new TrieSpec with the given hasher and sumTrie flag
func NewTrieSpec(hasher hash.Hash, sumTrie bool) TrieSpec {
func NewTrieSpec(
hasher hash.Hash,
sumTrie bool,
opts ...TrieSpecOption,
) TrieSpec {
spec := TrieSpec{th: *NewTrieHasher(hasher)}
spec.ph = &pathHasher{spec.th}
spec.vh = &valueHasher{spec.th}
spec.sumTrie = sumTrie

for _, opt := range opts {
opt(&spec)
}

return spec
}

Expand Down

0 comments on commit 0f9b3f3

Please sign in to comment.