mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
Align Beacon API with 2.2.0 spec (#10455)
This commit is contained in:
parent
588605ceeb
commit
be6f3892e8
@ -414,7 +414,7 @@ func (vs *Server) GetAggregateAttestation(ctx context.Context, req *ethpbv1.Aggr
|
||||
}
|
||||
|
||||
if bestMatchingAtt == nil {
|
||||
return nil, status.Error(codes.InvalidArgument, "No matching attestation found")
|
||||
return nil, status.Error(codes.NotFound, "No matching attestation found")
|
||||
}
|
||||
return ðpbv1.AggregateAttestationResponse{
|
||||
Data: migration.V1Alpha1AttestationToV1(bestMatchingAtt),
|
||||
@ -631,6 +631,9 @@ func (vs *Server) ProduceSyncCommitteeContribution(
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get sync subcommittee messages: %v", err)
|
||||
}
|
||||
if msgs == nil {
|
||||
return nil, status.Errorf(codes.NotFound, "No subcommittee messages found")
|
||||
}
|
||||
aggregatedSig, bits, err := vs.V1Alpha1Server.AggregatedSigAndAggregationBits(ctx, msgs, req.Slot, req.SubcommitteeIndex, req.BeaconBlockRoot)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get contribution data: %v", err)
|
||||
|
@ -1994,6 +1994,25 @@ func TestProduceSyncCommitteeContribution(t *testing.T) {
|
||||
aggregationBits := resp.Data.AggregationBits
|
||||
assert.Equal(t, true, aggregationBits.BitAt(0))
|
||||
assert.DeepEqual(t, sig, resp.Data.Signature)
|
||||
|
||||
syncCommitteePool = synccommittee.NewStore()
|
||||
v1Server = &v1alpha1validator.Server{
|
||||
SyncCommitteePool: syncCommitteePool,
|
||||
HeadFetcher: &mockChain.ChainService{
|
||||
SyncCommitteeIndices: []types.CommitteeIndex{0},
|
||||
},
|
||||
}
|
||||
server = Server{
|
||||
V1Alpha1Server: v1Server,
|
||||
SyncCommitteePool: syncCommitteePool,
|
||||
}
|
||||
req = ðpbv2.ProduceSyncCommitteeContributionRequest{
|
||||
Slot: 0,
|
||||
SubcommitteeIndex: 0,
|
||||
BeaconBlockRoot: root,
|
||||
}
|
||||
_, err = server.ProduceSyncCommitteeContribution(ctx, req)
|
||||
assert.ErrorContains(t, "No subcommittee messages found", err)
|
||||
}
|
||||
|
||||
func TestSubmitContributionAndProofs(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user