Some clean ups on the sync package (#13636)

This commit is contained in:
terence 2024-02-20 13:32:13 -08:00 committed by GitHub
parent 04dd60d1bf
commit 24b029bbef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@ func testBlocksWithKeys(t *testing.T, nBlocks uint64, nBlobs int, vr []byte) ([]
func TestVerify(t *testing.T) {
vr := make([]byte, 32)
copy(vr, []byte("yooooo"))
copy(vr, "yooooo")
blks, _, _, pks := testBlocksWithKeys(t, 2, 0, vr)
pubkeys := make([][fieldparams.BLSPubkeyLength]byte, len(pks))
for i := range pks {

View File

@ -151,14 +151,14 @@ func newBlockBatch(start, reqEnd primitives.Slot, size uint64) (blockBatch, bool
return nb, true
}
func (bat blockBatch) next(reqEnd primitives.Slot, size uint64) (blockBatch, bool) {
if bat.error() != nil {
return bat, false
func (bb blockBatch) next(reqEnd primitives.Slot, size uint64) (blockBatch, bool) {
if bb.error() != nil {
return bb, false
}
if bat.nonLinear() {
if bb.nonLinear() {
return blockBatch{}, false
}
return newBlockBatch(bat.end.Add(1), reqEnd, size)
return newBlockBatch(bb.end.Add(1), reqEnd, size)
}
// blocks returns the list of linear, canonical blocks read from the db.

View File

@ -15,7 +15,7 @@ var (
// ErrBatchSignatureMismatch is returned by VerifiedROBlobs when any of the blobs in the batch have a signature
// which does not match the signature for the block with a corresponding root.
ErrBatchSignatureMismatch = errors.New("Sidecar block header signature does not match signed block")
// ErrBlockRootMismatch is returned by VerifiedROBlobs in the scenario where the root of the given signed block
// ErrBatchBlockRootMismatch is returned by VerifiedROBlobs in the scenario where the root of the given signed block
// does not match the block header in one of the corresponding sidecars.
ErrBatchBlockRootMismatch = errors.New("Sidecar block header root does not match signed block")
)

View File

@ -54,7 +54,7 @@ func TestBlobAlignsWithBlock(t *testing.T) {
require.NoError(t, err)
rob, err := blocks.NewROBlock(blk)
require.NoError(t, err)
return rob, []blocks.ROBlob{blocks.ROBlob{}}
return rob, []blocks.ROBlob{{}}
},
},
}