Skip to content

Commit

Permalink
rabbit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Jan 18, 2025
1 parent 192f6d2 commit 7301b8c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hasher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,20 +901,20 @@ func TestComputeNsRange(t *testing.T) {
// TestEmptyRoot ensures that the empty root is always the same, under the same configuration, regardless of the state of the Hasher.
func TestEmptyRoot(t *testing.T) {
t.Run("the empty root should match a hard-coded empty root", func(t *testing.T) {
nIDSzie := 1
ignoreMaxNS := true
nIDSize := 1
ignoreMaxNs := true

hasher := NewNmtHasher(sha256.New(), namespace.IDSize(nIDSzie), ignoreMaxNS)
hasher := NewNmtHasher(sha256.New(), namespace.IDSize(nIDSize), ignoreMaxNs)
got := hasher.EmptyRoot()
want := []byte{0x0, 0x0, 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}
assert.Equal(t, want, got)
})

t.Run("empty root should return the same root even if the hasher is modified", func(t *testing.T) {
nIDSzie := 1
ignoreMaxNS := true
nIDSize := 1
ignoreMaxNs := true

hasher := NewNmtHasher(sha256.New(), namespace.IDSize(nIDSzie), ignoreMaxNS)
hasher := NewNmtHasher(sha256.New(), namespace.IDSize(nIDSize), ignoreMaxNs)
want := hasher.EmptyRoot()

// perform some operation with the hasher
Expand Down

0 comments on commit 7301b8c

Please sign in to comment.