From ece2b19ac06c9e2597d70a61af5cbde4e69eaeff Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 13 Feb 2026 13:09:19 +0100 Subject: [PATCH] rlp: add AppendRaw method to RawList (#33834) This is helpful when building a list from already-encoded elements. --- rlp/raw.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rlp/raw.go b/rlp/raw.go index 8d171ce0f6..96ad0427c8 100644 --- a/rlp/raw.go +++ b/rlp/raw.go @@ -145,6 +145,14 @@ func (r *RawList[T]) Append(item T) error { return nil } +// AppendRaw adds an encoded item to the list. +func (r *RawList[T]) AppendRaw(b []byte) { + if r.enc == nil { + r.enc = make([]byte, 9) + } + r.enc = append(r.enc, b...) +} + // StringSize returns the encoded size of a string. func StringSize(s string) uint64 { switch n := len(s); n {