mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
e01a898264
* exec payload iface * begin using iface * use iface more * build beacon * builds * txs field * fix * merge test * pass * test * refactor * fix up builder case * gaz * comments * el test * build * no mask * patch up * exec wrap * Terence feedback * builds * potuz suggestion * exec data error Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
25 lines
662 B
Go
25 lines
662 B
Go
package v3
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
"github.com/prysmaticlabs/prysm/consensus-types/interfaces"
|
|
enginev1 "github.com/prysmaticlabs/prysm/proto/engine/v1"
|
|
)
|
|
|
|
// SetLatestExecutionPayloadHeader for the beacon state.
|
|
func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionData) error {
|
|
if !b.hasInnerState() {
|
|
return ErrNilInnerState
|
|
}
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
header, ok := val.Proto().(*enginev1.ExecutionPayloadHeader)
|
|
if !ok {
|
|
return errors.New("value must be an execution payload header")
|
|
}
|
|
b.state.LatestExecutionPayloadHeader = header
|
|
b.markFieldAsDirty(latestExecutionPayloadHeader)
|
|
return nil
|
|
}
|