Skip to content

Commit

Permalink
Fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia committed Sep 25, 2024
1 parent a9590f2 commit 47f44b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ linters:
- varcheck

linters-settings:
cyclop:
max-complexity: 20
tagliatelle:
case:
rules:
Expand Down
7 changes: 7 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ func ComputeBlockHash(payload *api.VersionedExecutionPayload, parentBeaconRoot *
return phase0.Hash32{}, err
}
return phase0.Hash32(header.Hash()), nil
case spec.DataVersionElectra:
// Electra uses the same ExecutionPayload as Deneb
header, err := denebExecutionPayloadToBlockHeader(payload.Electra, parentBeaconRoot)
if err != nil {
return phase0.Hash32{}, err
}
return phase0.Hash32(header.Hash()), nil
case spec.DataVersionPhase0, spec.DataVersionAltair:
return phase0.Hash32{}, fmt.Errorf("%w: %d", ErrUnsupportedVersion, payload.Version)
case spec.DataVersionUnknown:
Expand Down

0 comments on commit 47f44b9

Please sign in to comment.