prysm-pulse/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go
Preston Van Loon c4c9a8465a
Faster hashing for attestation pool (#5217)
* use faster hash proto
* Merge branch 'master' into faster-att-pool
* gaz
* Merge branch 'faster-att-pool' of github.com:prysmaticlabs/prysm into faster-att-pool
* nil checks and failing tests
* Merge refs/heads/master into faster-att-pool
* Merge refs/heads/master into faster-att-pool
* Merge refs/heads/master into faster-att-pool
* Merge refs/heads/master into faster-att-pool
* Merge refs/heads/master into faster-att-pool
* Fix
* Merge branch 'faster-att-pool' of github.com:prysmaticlabs/prysm into faster-att-pool
* Fix tests
2020-03-26 23:55:25 +00:00

27 lines
777 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 := &ethpb.AggregateAttestationAndProof{Aggregate: &ethpb.Attestation{AggregationBits: bitfield.Bitlist{0x07}, Data: &ethpb.AttestationData{Slot: 4}}, 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")
}
}