From c3919a85c07e9540eb61d6087b9c087d4d28b087 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 28 Feb 2026 00:54:45 +0100 Subject: [PATCH] eth/protocols/eth: inline writeReceiptForHash into Derivable --- eth/protocols/eth/receipt.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/eth/protocols/eth/receipt.go b/eth/protocols/eth/receipt.go index e51c02fa2a..96e8c4399b 100644 --- a/eth/protocols/eth/receipt.go +++ b/eth/protocols/eth/receipt.go @@ -194,18 +194,12 @@ func (rl *ReceiptList) EncodeForStorage() (rlp.RawValue, error) { // Derivable returns a DerivableList, which can be used to decode func (rl *ReceiptList) Derivable() types.DerivableList { var bloomBuf [6]byte - write := writeReceiptForHash(&bloomBuf) - return newDerivableRawList(&rl.items, write) -} - -// writeReceiptForHash returns a write function that encodes receipts for hash derivation. -func writeReceiptForHash(bloomBuf *[6]byte) func([]byte, *bytes.Buffer) { - return func(data []byte, outbuf *bytes.Buffer) { + return newDerivableRawList(&rl.items, func(data []byte, outbuf *bytes.Buffer) { var r Receipt if r.decode(data) == nil { - r.encodeForHash(bloomBuf, outbuf) + r.encodeForHash(&bloomBuf, outbuf) } - } + }) } // blockReceiptsToNetwork takes a slice of rlp-encoded receipts, and transactions,