Skip to content

Commit 10d9f93

Browse files
jsvisafjl
andauthored
graphql: add yParity field for transactions (#27882)
Co-authored-by: Felix Lange <fjl@twurst.com>
1 parent 7ec60d5 commit 10d9f93

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

graphql/graphql.go

+10
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,16 @@ func (t *Transaction) V(ctx context.Context) hexutil.Big {
566566
return hexutil.Big(*v)
567567
}
568568

569+
func (t *Transaction) YParity(ctx context.Context) (*hexutil.Uint64, error) {
570+
tx, _ := t.resolve(ctx)
571+
if tx == nil || tx.Type() == types.LegacyTxType {
572+
return nil, nil
573+
}
574+
v, _, _ := tx.RawSignatureValues()
575+
ret := hexutil.Uint64(v.Int64())
576+
return &ret, nil
577+
}
578+
569579
func (t *Transaction) Raw(ctx context.Context) (hexutil.Bytes, error) {
570580
tx, _ := t.resolve(ctx)
571581
if tx == nil {

graphql/schema.go

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ const schema string = `
151151
r: BigInt!
152152
s: BigInt!
153153
v: BigInt!
154+
yParity: Long
154155
# Envelope transaction support
155156
type: Long
156157
accessList: [AccessTuple!]

0 commit comments

Comments
 (0)