prysm-pulse/beacon-chain/rpc/attester_server_test.go
Raul Jordan 61026103c6
Validator Attester Rewrite (#1487)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* tests passing after checking for empty committee and crosslink root

* address nishant comments
2019-02-06 10:20:38 -06:00

26 lines
579 B
Go

package rpc
import (
"context"
"testing"
pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
)
func TestAttestHead(t *testing.T) {
mockOperationService := &mockOperationService{}
attesterServer := &AttesterServer{
operationService: mockOperationService,
}
req := &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)
}
}