mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 03:51:29 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- 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/v5/consensus-types/primitives"
|
|
"github.com/prysmaticlabs/prysm/v5/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)
|
|
}
|
|
}
|