Skip to content

Commit

Permalink
graphql: add yParity field for transactions (#27882)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Lange <[email protected]>
  • Loading branch information
jsvisa and fjl authored Aug 9, 2023
1 parent 7ec60d5 commit 10d9f93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,16 @@ func (t *Transaction) V(ctx context.Context) hexutil.Big {
return hexutil.Big(*v)
}

func (t *Transaction) YParity(ctx context.Context) (*hexutil.Uint64, error) {
tx, _ := t.resolve(ctx)
if tx == nil || tx.Type() == types.LegacyTxType {
return nil, nil
}
v, _, _ := tx.RawSignatureValues()
ret := hexutil.Uint64(v.Int64())
return &ret, nil
}

func (t *Transaction) Raw(ctx context.Context) (hexutil.Bytes, error) {
tx, _ := t.resolve(ctx)
if tx == nil {
Expand Down
1 change: 1 addition & 0 deletions graphql/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const schema string = `
r: BigInt!
s: BigInt!
v: BigInt!
yParity: Long
# Envelope transaction support
type: Long
accessList: [AccessTuple!]
Expand Down

0 comments on commit 10d9f93

Please sign in to comment.