mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 16:37:39 +00:00
61026103c6
* 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
26 lines
579 B
Go
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)
|
|
}
|
|
}
|