mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 21:27:19 +00:00
27 lines
738 B
Go
27 lines
738 B
Go
|
package sync
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"reflect"
|
||
|
"testing"
|
||
|
|
||
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
||
|
"github.com/prysmaticlabs/go-bitfield"
|
||
|
"github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations"
|
||
|
)
|
||
|
|
||
|
func TestBeaconAggregateProofSubscriber_CanSave(t *testing.T) {
|
||
|
r := &Service{
|
||
|
attPool: attestations.NewPool(),
|
||
|
}
|
||
|
|
||
|
a := ðpb.AggregateAttestationAndProof{Aggregate: ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x07}}, AggregatorIndex: 100}
|
||
|
if err := r.beaconAggregateProofSubscriber(context.Background(), a); err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
if !reflect.DeepEqual(r.attPool.AggregatedAttestations(), []*ethpb.Attestation{a.Aggregate}) {
|
||
|
t.Error("Did not save aggregated attestation")
|
||
|
}
|
||
|
}
|