From 0f9b3f3f1cfea5c1fcf8837d2b5e8d8ab6d12dd7 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Thu, 13 Jun 2024 18:20:25 -0700 Subject: [PATCH] Add back options --- trie_spec.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trie_spec.go b/trie_spec.go index b0fd610..5dfae6c 100644 --- a/trie_spec.go +++ b/trie_spec.go @@ -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 }