2021-06-30 15:06:19 +00:00
|
|
|
package v1
|
2020-10-23 21:41:45 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-07-21 21:34:07 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2021-07-28 21:23:44 +00:00
|
|
|
statepb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2020-10-23 21:41:45 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Test_handlePendingAttestation_OutOfRange(t *testing.T) {
|
2021-07-23 13:07:40 +00:00
|
|
|
items := make([]*statepb.PendingAttestation, 1)
|
2020-10-23 21:41:45 +00:00
|
|
|
indices := []uint64{3}
|
|
|
|
_, err := handlePendingAttestation(items, indices, false)
|
|
|
|
assert.ErrorContains(t, "index 3 greater than number of pending attestations 1", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Test_handleEth1DataSlice_OutOfRange(t *testing.T) {
|
|
|
|
items := make([]*ethpb.Eth1Data, 1)
|
|
|
|
indices := []uint64{3}
|
2021-05-19 16:11:48 +00:00
|
|
|
_, err := HandleEth1DataSlice(items, indices, false)
|
2020-10-23 21:41:45 +00:00
|
|
|
assert.ErrorContains(t, "index 3 greater than number of items in eth1 data slice 1", err)
|
2021-05-19 16:11:48 +00:00
|
|
|
|
2020-10-23 21:41:45 +00:00
|
|
|
}
|