Skip to content

Commit

Permalink
Expose newTrieSpec publically
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Apr 11, 2024
1 parent c747189 commit de3749f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (ph *pathHasher) PathSize() int {
return ph.hasher.Size()
}

// HashValue hashes the producdes a digest of the data provided by the value hasher
// HashValue hashes the produces a digest of the data provided by the value hasher
func (vh *valueHasher) HashValue(data []byte) []byte {
return vh.digest(data)
}
Expand Down
4 changes: 2 additions & 2 deletions smst.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewSparseMerkleSumTrie(
options ...Option,
) *SMST {
smt := &SMT{
TrieSpec: newTrieSpec(hasher, true),
TrieSpec: NewTrieSpec(hasher, true),
nodes: nodes,
}
for _, option := range options {
Expand All @@ -32,7 +32,7 @@ func NewSparseMerkleSumTrie(
nvh := WithValueHasher(nil)
nvh(&smt.TrieSpec)
smst := &SMST{
TrieSpec: newTrieSpec(hasher, true),
TrieSpec: NewTrieSpec(hasher, true),
SMT: smt,
}
for _, option := range options {
Expand Down
2 changes: 1 addition & 1 deletion smt.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func NewSparseMerkleTrie(
options ...Option,
) *SMT {
smt := SMT{
TrieSpec: newTrieSpec(hasher, false),
TrieSpec: NewTrieSpec(hasher, false),
nodes: nodes,
}
for _, option := range options {
Expand Down
2 changes: 1 addition & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type TrieSpec struct {
sumTrie bool
}

func newTrieSpec(hasher hash.Hash, sumTrie bool) TrieSpec {
func NewTrieSpec(hasher hash.Hash, sumTrie bool) TrieSpec {
spec := TrieSpec{th: *newTrieHasher(hasher)}
spec.ph = &pathHasher{spec.th}
spec.vh = &valueHasher{spec.th}
Expand Down

0 comments on commit de3749f

Please sign in to comment.