Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Apr 30, 2024
1 parent f80a5c2 commit 1122d7a
Show file tree
Hide file tree
Showing 16 changed files with 163 additions and 111 deletions.
7 changes: 4 additions & 3 deletions beacon-chain/blockchain/head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/blstoexec"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1"
Expand Down Expand Up @@ -312,7 +313,7 @@ func TestSaveOrphanedAtts(t *testing.T) {

require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4))
require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount())
wantAtts := []*ethpb.Attestation{
wantAtts := []interfaces.Attestation{
blk3.Block.Body.Attestations[0],
blk2.Block.Body.Attestations[0],
blk1.Block.Body.Attestations[0],
Expand Down Expand Up @@ -389,7 +390,7 @@ func TestSaveOrphanedOps(t *testing.T) {

require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4))
require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount())
wantAtts := []*ethpb.Attestation{
wantAtts := []interfaces.Attestation{
blk3.Block.Body.Attestations[0],
blk2.Block.Body.Attestations[0],
blk1.Block.Body.Attestations[0],
Expand Down Expand Up @@ -517,7 +518,7 @@ func TestSaveOrphanedAtts_DoublyLinkedTrie(t *testing.T) {

require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4))
require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount())
wantAtts := []*ethpb.Attestation{
wantAtts := []interfaces.Attestation{
blk3.Block.Body.Attestations[0],
blk2.Block.Body.Attestations[0],
blk1.Block.Body.Attestations[0],
Expand Down
3 changes: 2 additions & 1 deletion beacon-chain/blockchain/process_attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
Expand Down Expand Up @@ -73,7 +74,7 @@ func TestStore_OnAttestation_ErrorConditions(t *testing.T) {

tests := []struct {
name string
a *ethpb.Attestation
a interfaces.Attestation
wantedErr string
}{
{
Expand Down
1 change: 1 addition & 0 deletions beacon-chain/core/helpers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ go_test(
"//beacon-chain/state/state-native:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library",
"//container/slice:go_default_library",
"//crypto/hash:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion beacon-chain/core/helpers/attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
Expand Down Expand Up @@ -238,7 +239,7 @@ func TestVerifyCheckpointEpoch_Ok(t *testing.T) {
func TestValidateNilAttestation(t *testing.T) {
tests := []struct {
name string
attestation *ethpb.Attestation
attestation interfaces.Attestation
errString string
}{
{
Expand Down
8 changes: 4 additions & 4 deletions beacon-chain/operations/attestations/kv/aggregated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) {
func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) {
tests := []struct {
name string
att *ethpb.Attestation
att interfaces.Attestation
count int
wantErrString string
}{
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestKV_Aggregated_AggregatedAttestations(t *testing.T) {
att1 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}})
att2 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}})
att3 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}})
atts := []*ethpb.Attestation{att1, att2, att3}
atts := []interfaces.Attestation{att1, att2, att3}

for _, att := range atts {
require.NoError(t, cache.SaveAggregatedAttestation(att))
Expand Down Expand Up @@ -253,7 +253,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) {
require.NoError(t, cache.DeleteAggregatedAttestation(att3))

returned := cache.AggregatedAttestations()
wanted := []*ethpb.Attestation{att2}
wanted := []interfaces.Attestation{att2}
assert.DeepEqual(t, wanted, returned)
})

Expand All @@ -270,7 +270,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) {
require.NoError(t, cache.DeleteAggregatedAttestation(att4))

returned := cache.AggregatedAttestations()
wanted := []*ethpb.Attestation{att1, att2}
wanted := []interfaces.Attestation{att1, att2}
sort.Slice(returned, func(i, j int) bool {
return string(returned[i].GetAggregationBits()) < string(returned[j].GetAggregationBits())
})
Expand Down
7 changes: 4 additions & 3 deletions beacon-chain/operations/attestations/kv/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/prysmaticlabs/go-bitfield"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
Expand All @@ -17,7 +18,7 @@ func TestKV_BlockAttestation_CanSaveRetrieve(t *testing.T) {
att1 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}})
att2 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}})
att3 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}})
atts := []*ethpb.Attestation{att1, att2, att3}
atts := []interfaces.Attestation{att1, att2, att3}

for _, att := range atts {
require.NoError(t, cache.SaveBlockAttestation(att))
Expand All @@ -43,7 +44,7 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) {
att1 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}})
att2 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}})
att3 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}})
atts := []*ethpb.Attestation{att1, att2, att3}
atts := []interfaces.Attestation{att1, att2, att3}

for _, att := range atts {
require.NoError(t, cache.SaveBlockAttestation(att))
Expand All @@ -53,6 +54,6 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) {
require.NoError(t, cache.DeleteBlockAttestation(att3))

returned := cache.BlockAttestations()
wanted := []*ethpb.Attestation{att2}
wanted := []interfaces.Attestation{att2}
assert.DeepEqual(t, wanted, returned)
}
7 changes: 4 additions & 3 deletions beacon-chain/operations/attestations/kv/forkchoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/prysmaticlabs/go-bitfield"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
Expand All @@ -17,7 +18,7 @@ func TestKV_Forkchoice_CanSaveRetrieve(t *testing.T) {
att1 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}})
att2 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}})
att3 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}})
atts := []*ethpb.Attestation{att1, att2, att3}
atts := []interfaces.Attestation{att1, att2, att3}

for _, att := range atts {
require.NoError(t, cache.SaveForkchoiceAttestation(att))
Expand All @@ -38,7 +39,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) {
att1 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}})
att2 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}})
att3 := util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}})
atts := []*ethpb.Attestation{att1, att2, att3}
atts := []interfaces.Attestation{att1, att2, att3}

for _, att := range atts {
require.NoError(t, cache.SaveForkchoiceAttestation(att))
Expand All @@ -48,7 +49,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) {
require.NoError(t, cache.DeleteForkchoiceAttestation(att3))

returned := cache.ForkchoiceAttestations()
wanted := []*ethpb.Attestation{att2}
wanted := []interfaces.Attestation{att2}
assert.DeepEqual(t, wanted, returned)
}

Expand Down
16 changes: 8 additions & 8 deletions beacon-chain/operations/attestations/kv/unaggregated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) {
tests := []struct {
name string
att *ethpb.Attestation
att interfaces.Attestation
count int
wantErrString string
}{
Expand Down Expand Up @@ -67,8 +67,8 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) {
cache.seenAtt.Set(string(r[:]), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration)
assert.Equal(t, 0, len(cache.unAggregatedAtt), "Invalid start pool, atts: %d", len(cache.unAggregatedAtt))

if tt.att != nil && tt.att.Signature == nil {
tt.att.Signature = make([]byte, fieldparams.BLSSignatureLength)
if tt.att != nil && tt.att.GetSignature() == nil {
tt.att.(*ethpb.Attestation).Signature = make([]byte, fieldparams.BLSSignatureLength)
}

err := cache.SaveUnaggregatedAttestation(tt.att)
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestKV_Unaggregated_DeleteUnaggregatedAttestation(t *testing.T) {
}
returned, err := cache.UnaggregatedAttestations()
require.NoError(t, err)
assert.DeepEqual(t, []*ethpb.Attestation{}, returned)
assert.DeepEqual(t, []interfaces.Attestation{}, returned)
})
}

Expand Down Expand Up @@ -230,7 +230,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) {
assert.Equal(t, 0, cache.UnaggregatedAttestationCount())
returned, err := cache.UnaggregatedAttestations()
require.NoError(t, err)
assert.DeepEqual(t, []*ethpb.Attestation{}, returned)
assert.DeepEqual(t, []interfaces.Attestation{}, returned)
})
}

Expand All @@ -247,9 +247,9 @@ func TestKV_Unaggregated_UnaggregatedAttestationsBySlotIndex(t *testing.T) {
}
ctx := context.Background()
returned := cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 1)
assert.DeepEqual(t, []*ethpb.Attestation{att1}, returned)
assert.DeepEqual(t, []interfaces.Attestation{att1}, returned)
returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 2)
assert.DeepEqual(t, []*ethpb.Attestation{att2}, returned)
assert.DeepEqual(t, []interfaces.Attestation{att2}, returned)
returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 2, 1)
assert.DeepEqual(t, []*ethpb.Attestation{att3}, returned)
assert.DeepEqual(t, []interfaces.Attestation{att3}, returned)
}
1 change: 1 addition & 0 deletions beacon-chain/operations/slashings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ go_test(
"//beacon-chain/state:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library",
"//crypto/bls:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
Expand Down
13 changes: 7 additions & 6 deletions beacon-chain/operations/slashings/service_attester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/crypto/bls"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
Expand Down Expand Up @@ -455,7 +456,7 @@ func TestPool_PendingAttesterSlashings(t *testing.T) {
params.SetupTestConfigCleanup(t)
beaconState, privKeys := util.DeterministicGenesisState(t, 64)
pendingSlashings := make([]*PendingAttesterSlashing, 20)
slashings := make([]*ethpb.AttesterSlashing, 20)
slashings := make([]interfaces.AttesterSlashing, 20)
for i := 0; i < len(pendingSlashings); i++ {
sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i))
require.NoError(t, err)
Expand All @@ -468,14 +469,14 @@ func TestPool_PendingAttesterSlashings(t *testing.T) {
tests := []struct {
name string
fields fields
want []*ethpb.AttesterSlashing
want []interfaces.AttesterSlashing
}{
{
name: "Empty list",
fields: fields{
pending: []*PendingAttesterSlashing{},
},
want: []*ethpb.AttesterSlashing{},
want: []interfaces.AttesterSlashing{},
},
{
name: "All pending",
Expand Down Expand Up @@ -530,7 +531,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) {
require.NoError(t, beaconState.UpdateValidatorAtIndex(5, val))
pendingSlashings := make([]*PendingAttesterSlashing, 20)
pendingSlashings2 := make([]*PendingAttesterSlashing, 20)
slashings := make([]*ethpb.AttesterSlashing, 20)
slashings := make([]interfaces.AttesterSlashing, 20)
for i := 0; i < len(pendingSlashings); i++ {
sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i))
require.NoError(t, err)
Expand All @@ -548,7 +549,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) {
tests := []struct {
name string
fields fields
want []*ethpb.AttesterSlashing
want []interfaces.AttesterSlashing
}{
{
name: "One item",
Expand Down Expand Up @@ -588,7 +589,7 @@ func TestPool_PendingAttesterSlashings_NoDuplicates(t *testing.T) {
params.OverrideBeaconConfig(conf)
beaconState, privKeys := util.DeterministicGenesisState(t, 64)
pendingSlashings := make([]*PendingAttesterSlashing, 3)
slashings := make([]*ethpb.AttesterSlashing, 3)
slashings := make([]interfaces.AttesterSlashing, 3)
for i := 0; i < 2; i++ {
sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i))
require.NoError(t, err)
Expand Down
16 changes: 11 additions & 5 deletions beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,22 +545,26 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) {
state, _ := util.DeterministicGenesisState(t, numValidators)

// Next up we convert the test attestations to indexed form:
indexedAtts := make([]ethpb.IndexedAtt, len(atts)+len(atts2))
indexedAtts := make([]*ethpb.IndexedAttestation, len(atts)+len(atts2))
for i := 0; i < len(atts); i++ {
att := atts[i]
committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, att.Data.CommitteeIndex)
require.NoError(t, err)
idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee)
require.NoError(t, err, "Could not convert attestation to indexed")
indexedAtts[i] = idxAtt
a, ok := idxAtt.(*ethpb.IndexedAttestation)
require.Equal(t, true, ok, "unexpected type of indexed attestation")
indexedAtts[i] = a
}
for i := 0; i < len(atts2); i++ {
att := atts2[i]
committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, att.Data.CommitteeIndex)
require.NoError(t, err)
idxAtt, err := attestation.ConvertToIndexed(ctx, atts2[i], committee)
require.NoError(t, err, "Could not convert attestation to indexed")
indexedAtts[i+len(atts)] = idxAtt
a, ok := idxAtt.(*ethpb.IndexedAttestation)
require.Equal(t, true, ok, "unexpected type of indexed attestation")
indexedAtts[i+len(atts)] = a
}

bs := &Server{
Expand Down Expand Up @@ -652,14 +656,16 @@ func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) {
require.NoError(t, state.SetSlot(startSlot))

// Next up we convert the test attestations to indexed form:
indexedAtts := make([]ethpb.IndexedAtt, len(atts))
indexedAtts := make([]*ethpb.IndexedAttestation, len(atts))
for i := 0; i < len(atts); i++ {
att := atts[i]
committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, att.Data.CommitteeIndex)
require.NoError(t, err)
idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee)
require.NoError(t, err, "Could not convert attestation to indexed")
indexedAtts[i] = idxAtt
a, ok := idxAtt.(*ethpb.IndexedAttestation)
require.Equal(t, true, ok, "unexpected type of indexed attestation")
indexedAtts[i] = a
}

bs := &Server{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/require"
Expand All @@ -28,7 +29,7 @@ func TestServer_getSlashings(t *testing.T) {
require.NoError(t, err)
}

attSlashings := make([]*ethpb.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings)
attSlashings := make([]interfaces.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings)
for i := uint64(0); i < params.BeaconConfig().MaxAttesterSlashings; i++ {
attesterSlashing, err := util.GenerateAttesterSlashingForValidator(
beaconState,
Expand Down
5 changes: 3 additions & 2 deletions beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations"
lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
Expand All @@ -34,7 +35,7 @@ func TestBeaconAggregateProofSubscriber_CanSaveAggregatedAttestation(t *testing.
Signature: make([]byte, fieldparams.BLSSignatureLength),
}
require.NoError(t, r.beaconAggregateProofSubscriber(context.Background(), a))
assert.DeepSSZEqual(t, []*ethpb.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation")
assert.DeepSSZEqual(t, []interfaces.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation")
}

func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testing.T) {
Expand All @@ -59,5 +60,5 @@ func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testin

atts, err := r.cfg.attPool.UnaggregatedAttestations()
require.NoError(t, err)
assert.DeepEqual(t, []*ethpb.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation")
assert.DeepEqual(t, []interfaces.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation")
}
Loading

0 comments on commit 1122d7a

Please sign in to comment.