mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Fix: payload attribute v3 return nil (#12736)
This commit is contained in:
parent
96a9a6fc16
commit
83aaf043e4
@ -83,6 +83,9 @@ func (a *data) PbV3() (*enginev1.PayloadAttributesV3, error) {
|
||||
if a.version != version.Deneb {
|
||||
return nil, consensus_types.ErrNotSupported("PbV3", a.version)
|
||||
}
|
||||
if a.timeStamp == 0 && len(a.prevRandao) == 0 && len(a.parentBeaconBlockRoot) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return &enginev1.PayloadAttributesV3{
|
||||
Timestamp: a.timeStamp,
|
||||
PrevRandao: a.prevRandao,
|
||||
|
@ -172,6 +172,16 @@ func TestPayloadAttributeGetters(t *testing.T) {
|
||||
require.ErrorContains(t, "PbV3 is not supported for capella: unsupported getter", err)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Get PbDeneb (nil)",
|
||||
tc: func(t *testing.T) {
|
||||
a, err := New(&enginev1.PayloadAttributesV3{})
|
||||
require.NoError(t, err)
|
||||
got, err := a.PbV3()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, (*enginev1.PayloadAttributesV3)(nil), got)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user