mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Fix a bunch of deepsource warnings (#11814)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user