Skip to content

Commit 6c9148b

Browse files
s1naryanschneider
authored andcommitted
graphql: add rawReceipt field to transaction type (ethereum#24738)
* graphql: add tx receiptsRLP field * use MarshalBinary Co-authored-by: Ryan Schneider <[email protected]> * update schema Co-authored-by: Ryan Schneider <[email protected]> * rename to rawReceipt * indent fix Co-authored-by: Ryan Schneider <[email protected]>
1 parent e57f75b commit 6c9148b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

graphql/graphql.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,14 @@ func (t *Transaction) V(ctx context.Context) (hexutil.Big, error) {
514514
return hexutil.Big(*v), nil
515515
}
516516

517+
func (t *Transaction) RawReceipt(ctx context.Context) (hexutil.Bytes, error) {
518+
receipt, err := t.getReceipt(ctx)
519+
if err != nil || receipt == nil {
520+
return nil, err
521+
}
522+
return receipt.MarshalBinary()
523+
}
524+
517525
type BlockType int
518526

519527
// Block represents an Ethereum block.

graphql/schema.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ const schema string = `
137137
r: BigInt!
138138
s: BigInt!
139139
v: BigInt!
140-
#Envelope transaction support
140+
# Envelope transaction support
141141
type: Int
142142
accessList: [AccessTuple!]
143+
# RawReceipt is the binary encoding of the receipt. For post EIP-2718 typed transactions
144+
# this is equivalent to TxType || ReceiptEncoding.
145+
rawReceipt: Bytes!
143146
}
144147
145148
# BlockFilterCriteria encapsulates log filter criteria for a filter applied

0 commit comments

Comments
 (0)