mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Correctly return electra attestations for block getter (#13993)
This commit is contained in:
@@ -1116,7 +1116,7 @@ func (b *BeaconBlockBody) Attestations() []interfaces.Attestation {
|
||||
return nil
|
||||
}
|
||||
atts = make([]interfaces.Attestation, len(b.attestationsElectra))
|
||||
for i, a := range b.attestations {
|
||||
for i, a := range b.attestationsElectra {
|
||||
atts[i] = a
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,6 +369,19 @@ func Test_BeaconBlockBody_Attestations(t *testing.T) {
|
||||
assert.DeepSSZEqual(t, a, bb.Block().Body().Attestations())
|
||||
}
|
||||
|
||||
func Test_BeaconBlockBody_ElectraAttestations(t *testing.T) {
|
||||
bb := &SignedBeaconBlock{
|
||||
block: &BeaconBlock{body: &BeaconBlockBody{
|
||||
version: version.Electra,
|
||||
attestationsElectra: []*eth.AttestationElectra{{
|
||||
Signature: []byte("electra"),
|
||||
}},
|
||||
}}}
|
||||
a := bb.Block().Body().Attestations()
|
||||
require.Equal(t, 1, len(a))
|
||||
require.DeepEqual(t, a[0].GetSignature(), []byte("electra"))
|
||||
}
|
||||
|
||||
func Test_BeaconBlockBody_Deposits(t *testing.T) {
|
||||
d := make([]*eth.Deposit, 0)
|
||||
bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}}
|
||||
|
||||
Reference in New Issue
Block a user