Skip to content

Commit

Permalink
chore: remove unnecessary addressing of registeredExtras
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR4N committed Dec 16, 2024
1 parent 27886ea commit c73cbde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/types/block.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var _ interface {

// EncodeRLP implements the [rlp.Encoder] interface.
func (h *Header) EncodeRLP(w io.Writer) error {
if r := &registeredExtras; r.Registered() {
if r := registeredExtras; r.Registered() {
return r.Get().hooks.hooksFromHeader(h).EncodeRLP(h, w)
}
return h.encodeRLP(w)
Expand All @@ -53,7 +53,7 @@ func decodeHeaderRLPDirectly(h *Header, s *rlp.Stream) error {

// DecodeRLP implements the [rlp.Decoder] interface.
func (h *Header) DecodeRLP(s *rlp.Stream) error {
if r := &registeredExtras; r.Registered() {
if r := registeredExtras; r.Registered() {
return r.Get().hooks.hooksFromHeader(h).DecodeRLP(h, s)
}
return decodeHeaderRLPDirectly(h, s)
Expand All @@ -64,7 +64,7 @@ func (e ExtraPayloads[HPtr, SA]) hooksFromHeader(h *Header) HeaderHooks {
}

func (h *Header) extraPayload() *pseudo.Type {
r := &registeredExtras
r := registeredExtras
if !r.Registered() {
// See params.ChainConfig.extraPayload() for panic rationale.
panic(fmt.Sprintf("%T.extraPayload() called before RegisterExtras()", r))
Expand Down

0 comments on commit c73cbde

Please sign in to comment.