mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
* retrieve and save blobs during backfill * Update beacon-chain/sync/backfill/batch.go Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com> * Update beacon-chain/sync/backfill/blobs.go Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com> * Update beacon-chain/sync/backfill/metrics.go Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com> * make blobSync initialization path a little safer * use bytes.Equal to avoid extra allocation * stop using log.Fatal and other little cleanups * wrap up post blob sync actions in batch mutator * unit test coverage on verifier --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com> Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
22 lines
500 B
Go
22 lines
500 B
Go
package backfill
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
|
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
|
)
|
|
|
|
func TestSortBatchDesc(t *testing.T) {
|
|
orderIn := []primitives.Slot{100, 10000, 1}
|
|
orderOut := []primitives.Slot{10000, 100, 1}
|
|
batches := make([]batch, len(orderIn))
|
|
for i := range orderIn {
|
|
batches[i] = batch{end: orderIn[i]}
|
|
}
|
|
sortBatchDesc(batches)
|
|
for i := range orderOut {
|
|
require.Equal(t, orderOut[i], batches[i].end)
|
|
}
|
|
}
|