2019-01-28 15:40:40 +00:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
|
|
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAttestHead(t *testing.T) {
|
2019-01-31 18:54:24 +00:00
|
|
|
mockOperationService := &mockOperationService{}
|
2019-01-28 15:40:40 +00:00
|
|
|
attesterServer := &AttesterServer{
|
2019-01-31 18:54:24 +00:00
|
|
|
operationService: mockOperationService,
|
2019-01-28 15:40:40 +00:00
|
|
|
}
|
|
|
|
req := &pb.AttestRequest{
|
|
|
|
Attestation: &pbp2p.Attestation{
|
|
|
|
Data: &pbp2p.AttestationData{
|
|
|
|
Slot: 999,
|
|
|
|
Shard: 1,
|
|
|
|
ShardBlockRootHash32: []byte{'a'},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
if _, err := attesterServer.AttestHead(context.Background(), req); err != nil {
|
|
|
|
t.Errorf("Could not attest head correctly: %v", err)
|
|
|
|
}
|
|
|
|
}
|