Skip to content

Commit

Permalink
fix testing/util tests
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Aug 6, 2024
1 parent 15f6d29 commit 75ef9a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion testing/util/epbs_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func SignExecutionPayloadHeader(
}
func generateKzgCommitments(n uint64) ([][]byte, error) {
kzgs := make([][]byte, n)
for i := range n {
for i := range kzgs {
kzgs[i] = make([]byte, 48)
_, err := rand.Read(kzgs[i])
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions testing/util/random/epbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func BeaconBlockBody(t *testing.T) *ethpb.BeaconBlockBodyEpbs {
{Header_1: SignedBeaconBlockHeader(t),
Header_2: SignedBeaconBlockHeader(t)},
},
AttesterSlashings: []*ethpb.AttesterSlashing{
AttesterSlashings: []*ethpb.AttesterSlashingElectra{
{
Attestation_1: IndexedAttestation(t),
Attestation_2: IndexedAttestation(t),
},
},
Attestations: []*ethpb.Attestation{Attestation(t), Attestation(t), Attestation(t)},
Attestations: []*ethpb.AttestationElectra{Attestation(t), Attestation(t), Attestation(t)},
Deposits: []*ethpb.Deposit{Deposit(t), Deposit(t), Deposit(t)},
VoluntaryExits: []*ethpb.SignedVoluntaryExit{SignedVoluntaryExit(t), SignedVoluntaryExit(t)},
SyncAggregate: &ethpb.SyncAggregate{
Expand Down Expand Up @@ -83,17 +83,17 @@ func SignedBeaconBlockHeader(t *testing.T) *ethpb.SignedBeaconBlockHeader {
}

// IndexedAttestation creates a random IndexedAttestation for testing purposes.
func IndexedAttestation(t *testing.T) *ethpb.IndexedAttestation {
return &ethpb.IndexedAttestation{
func IndexedAttestation(t *testing.T) *ethpb.IndexedAttestationElectra {
return &ethpb.IndexedAttestationElectra{
AttestingIndices: []uint64{randomUint64(t), randomUint64(t), randomUint64(t)},
Data: AttestationData(t),
Signature: randomBytes(96, t),
}
}

// Attestation creates a random Attestation for testing purposes.
func Attestation(t *testing.T) *ethpb.Attestation {
return &ethpb.Attestation{
func Attestation(t *testing.T) *ethpb.AttestationElectra {
return &ethpb.AttestationElectra{
AggregationBits: bitfield.NewBitlist(123),
Data: AttestationData(t),
Signature: randomBytes(96, t),
Expand Down

0 comments on commit 75ef9a6

Please sign in to comment.