Skip to content

Commit

Permalink
graphql: add rawReceipt field to transaction type (ethereum#24738)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
2 people authored and sadoci committed Jan 27, 2023
1 parent 19d420d commit 332cc70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,14 @@ func (t *Transaction) V(ctx context.Context) (hexutil.Big, error) {
return hexutil.Big(*v), nil
}

func (t *Transaction) RawReceipt(ctx context.Context) (hexutil.Bytes, error) {
receipt, err := t.getReceipt(ctx)
if err != nil || receipt == nil {
return nil, err
}
return receipt.MarshalBinary()
}

type BlockType int

// Block represents an Ethereum block.
Expand Down
5 changes: 4 additions & 1 deletion graphql/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,12 @@ const schema string = `
r: BigInt!
s: BigInt!
v: BigInt!
#Envelope transaction support
# Envelope transaction support
type: Int
accessList: [AccessTuple!]
# RawReceipt is the binary encoding of the receipt. For post EIP-2718 typed transactions
# this is equivalent to TxType || ReceiptEncoding.
rawReceipt: Bytes!
}
# BlockFilterCriteria encapsulates log filter criteria for a filter applied
Expand Down

0 comments on commit 332cc70

Please sign in to comment.