Fix a bunch of deepsource warnings (#11814)

This commit is contained in:
Patrice Vignola
2022-12-22 01:20:10 -08:00
committed by GitHub
parent 77a9dca9eb
commit 83f48350b2
73 changed files with 197 additions and 197 deletions

View File

@@ -63,7 +63,7 @@ func BitwiseMerkleize(hasher HashFn, chunks [][32]byte, count, limit uint64) ([3
// PackByChunk a given byte array's final chunk with zeroes if needed.
func PackByChunk(serializedItems [][]byte) ([][bytesPerChunk]byte, error) {
emptyChunk := [bytesPerChunk]byte{}
var emptyChunk [bytesPerChunk]byte
// If there are no items, we return an empty chunk.
if len(serializedItems) == 0 {
return [][bytesPerChunk]byte{emptyChunk}, nil

View File

@@ -86,7 +86,7 @@ func Merkleize(hasher Hasher, count, limit uint64, leaf func(i uint64) []byte) (
tmp := make([][32]byte, limitDepth+1)
j := uint8(0)
hArr := [32]byte{}
var hArr [32]byte
h := hArr[:]
merge := func(i uint64) {
@@ -151,7 +151,7 @@ func ConstructProof(hasher Hasher, count, limit uint64, leaf func(i uint64) []by
tmp := make([][32]byte, limitDepth+1)
j := uint8(0)
hArr := [32]byte{}
var hArr [32]byte
h := hArr[:]
merge := func(i uint64) {

View File

@@ -41,7 +41,7 @@ func TestMerkleizeLimitAndCountAreZero(t *testing.T) {
leafIndexer := func(i uint64) []byte {
return chunks[i]
}
expected := [32]byte{}
var expected [32]byte
result := ssz.Merkleize(hashFn, count, limit, leafIndexer)
assert.Equal(t, expected, result)
}