Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql: add tx rawReceipt field #24738

Merged
merged 5 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
)

Expand Down Expand Up @@ -514,6 +515,18 @@ func (t *Transaction) V(ctx context.Context) (hexutil.Big, error) {
return hexutil.Big(*v), nil
}

func (t *Transaction) ReceiptsRLP(ctx context.Context) (hexutil.Bytes, error) {
receipt, err := t.getReceipt(ctx)
if err != nil || receipt == nil {
return nil, err
}
res, err := rlp.EncodeToBytes(receipt)
if err != nil {
return nil, err
}
return res, nil
}
s1na marked this conversation as resolved.
Show resolved Hide resolved

type BlockType int

// Block represents an Ethereum block.
Expand Down
4 changes: 3 additions & 1 deletion graphql/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ const schema string = `
r: BigInt!
s: BigInt!
v: BigInt!
#Envelope transaction support
# Envelope transaction support
type: Int
accessList: [AccessTuple!]
# RLP-encoding of the receipts
receiptsRLP: Bytes!
s1na marked this conversation as resolved.
Show resolved Hide resolved
}

# BlockFilterCriteria encapsulates log filter criteria for a filter applied
Expand Down