github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/state/v1/helpers_test.go (about)

     1  package v1
     2  
     3  import (
     4  	"testing"
     5  
     6  	pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
     7  	ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
     8  	"github.com/prysmaticlabs/prysm/shared/testutil/assert"
     9  )
    10  
    11  func Test_handlePendingAttestation_OutOfRange(t *testing.T) {
    12  	items := make([]*pb.PendingAttestation, 1)
    13  	indices := []uint64{3}
    14  	_, err := handlePendingAttestation(items, indices, false)
    15  	assert.ErrorContains(t, "index 3 greater than number of pending attestations 1", err)
    16  }
    17  
    18  func Test_handleEth1DataSlice_OutOfRange(t *testing.T) {
    19  	items := make([]*ethpb.Eth1Data, 1)
    20  	indices := []uint64{3}
    21  	_, err := HandleEth1DataSlice(items, indices, false)
    22  	assert.ErrorContains(t, "index 3 greater than number of items in eth1 data slice 1", err)
    23  
    24  }