Skip to content

Commit

Permalink
core/types: add support for BlobTxType receipts (#27470)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Lange <fjl@twurst.com>
  • Loading branch information
holiman and fjl committed Jun 15, 2023
1 parent 93ecd77 commit 9cf9fae
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/types/receipt.go
Expand Up @@ -194,7 +194,7 @@ func (r *Receipt) decodeTyped(b []byte) error {
return errShortTypedReceipt
}
switch b[0] {
case DynamicFeeTxType, AccessListTxType:
case DynamicFeeTxType, AccessListTxType, BlobTxType:
var data receiptRLP
err := rlp.DecodeBytes(b[1:], &data)
if err != nil {
Expand Down Expand Up @@ -296,14 +296,13 @@ func (rs Receipts) Len() int { return len(rs) }
func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
r := rs[i]
data := &receiptRLP{r.statusEncoding(), r.CumulativeGasUsed, r.Bloom, r.Logs}
switch r.Type {
case LegacyTxType:
rlp.Encode(w, data)
case AccessListTxType:
w.WriteByte(AccessListTxType)
if r.Type == LegacyTxType {
rlp.Encode(w, data)
case DynamicFeeTxType:
w.WriteByte(DynamicFeeTxType)
return
}
w.WriteByte(r.Type)
switch r.Type {
case AccessListTxType, DynamicFeeTxType, BlobTxType:
rlp.Encode(w, data)
default:
// For unsupported types, write nothing. Since this is for
Expand Down

0 comments on commit 9cf9fae

Please sign in to comment.