From 070065c5d985001c1706c425e323b3376927383b Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 15 Apr 2025 12:45:42 +0200 Subject: [PATCH] eth/protocols/eth: add decoder method for ReceiptList69 --- eth/protocols/eth/receipt.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eth/protocols/eth/receipt.go b/eth/protocols/eth/receipt.go index af315dcc6a..d7476d9b79 100644 --- a/eth/protocols/eth/receipt.go +++ b/eth/protocols/eth/receipt.go @@ -150,6 +150,21 @@ func (rl *ReceiptList69) EncodeIndex(i int, b *bytes.Buffer) { w.Flush() } +func (rl *ReceiptList69) DecodeRLP(s *rlp.Stream) error { + if _, err := s.List(); err != nil { + return err + } + for i := 0; s.MoreDataInList(); i++ { + var item Receipt + err := item.DecodeRLP(s) + if err != nil { + return fmt.Errorf("receipt %d: %v", err) + } + rl.items = append(rl.items, item) + } + return s.ListEnd() +} + func (rl *ReceiptList69) toStorageReceiptsRLP() rlp.RawValue { var ( out bytes.Buffer