fix Go tests
- merkletree: fix broken test case - fixtures: fix compatibility with Bazel
This commit is contained in:
parent
4ddc64e2c0
commit
2742cd8867
|
@ -1,3 +1,5 @@
|
|||
//go:build rocksdb
|
||||
|
||||
package create
|
||||
|
||||
import (
|
||||
|
|
|
@ -29,7 +29,7 @@ func shreds(t testing.TB, network string, slot uint64, shredType rune) [][]byte
|
|||
})
|
||||
var shreds [][]byte
|
||||
for _, entry := range entries {
|
||||
if !entry.Type().IsRegular() {
|
||||
if entry.Type().IsDir() {
|
||||
continue
|
||||
}
|
||||
name := entry.Name()
|
||||
|
|
|
@ -14,7 +14,7 @@ func TestHashNodes(t *testing.T) {
|
|||
}{
|
||||
"Empty": {
|
||||
leaves: nil,
|
||||
root: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
root: "",
|
||||
},
|
||||
"One": {
|
||||
leaves: [][]byte{[]byte("test")},
|
||||
|
@ -38,7 +38,11 @@ func TestHashNodes(t *testing.T) {
|
|||
for _, node := range actual.Nodes {
|
||||
t.Log(hex.EncodeToString(node[:]))
|
||||
}
|
||||
if tc.root == "" {
|
||||
assert.Nil(t, actualRoot)
|
||||
} else {
|
||||
assert.Equal(t, tc.root, hex.EncodeToString(actualRoot[:]))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -47,5 +51,5 @@ func TestHashNodes_One(t *testing.T) {
|
|||
input := []byte("test")
|
||||
actual := HashNodes([][]byte{input})
|
||||
expected := HashLeaf(input)
|
||||
assert.Equal(t, expected, actual.GetRoot())
|
||||
assert.Equal(t, expected, *actual.GetRoot())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue