Unverified Commit 9cf9fae6 authored by Martin Holst Swende's avatar Martin Holst Swende Committed by GitHub

core/types: add support for BlobTxType receipts (#27470)

Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
parent 93ecd77d
...@@ -194,7 +194,7 @@ func (r *Receipt) decodeTyped(b []byte) error { ...@@ -194,7 +194,7 @@ func (r *Receipt) decodeTyped(b []byte) error {
return errShortTypedReceipt return errShortTypedReceipt
} }
switch b[0] { switch b[0] {
case DynamicFeeTxType, AccessListTxType: case DynamicFeeTxType, AccessListTxType, BlobTxType:
var data receiptRLP var data receiptRLP
err := rlp.DecodeBytes(b[1:], &data) err := rlp.DecodeBytes(b[1:], &data)
if err != nil { if err != nil {
...@@ -296,14 +296,13 @@ func (rs Receipts) Len() int { return len(rs) } ...@@ -296,14 +296,13 @@ func (rs Receipts) Len() int { return len(rs) }
func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
r := rs[i] r := rs[i]
data := &receiptRLP{r.statusEncoding(), r.CumulativeGasUsed, r.Bloom, r.Logs} data := &receiptRLP{r.statusEncoding(), r.CumulativeGasUsed, r.Bloom, r.Logs}
switch r.Type { if r.Type == LegacyTxType {
case LegacyTxType:
rlp.Encode(w, data)
case AccessListTxType:
w.WriteByte(AccessListTxType)
rlp.Encode(w, data) rlp.Encode(w, data)
case DynamicFeeTxType: return
w.WriteByte(DynamicFeeTxType) }
w.WriteByte(r.Type)
switch r.Type {
case AccessListTxType, DynamicFeeTxType, BlobTxType:
rlp.Encode(w, data) rlp.Encode(w, data)
default: default:
// For unsupported types, write nothing. Since this is for // For unsupported types, write nothing. Since this is for
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment