From e7fba5989241abb34db55456c6ecc93142e2c77d Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 8 Aug 2023 21:01:08 +0800 Subject: [PATCH 1/3] graphql: add yParity in Transaction Signed-off-by: jsvisa --- graphql/schema.go | 1 + 1 file changed, 1 insertion(+) diff --git a/graphql/schema.go b/graphql/schema.go index a4eeb47daddfc..5de5bad305e85 100644 --- a/graphql/schema.go +++ b/graphql/schema.go @@ -151,6 +151,7 @@ const schema string = ` r: BigInt! s: BigInt! v: BigInt! + yParity: Long # Envelope transaction support type: Long accessList: [AccessTuple!] From 40f03b34e69db1f3bcd46a691bd866f4bb16bea3 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 8 Aug 2023 21:03:19 +0800 Subject: [PATCH 2/3] graphql: retrieve yParity from v Signed-off-by: jsvisa --- graphql/graphql.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/graphql/graphql.go b/graphql/graphql.go index b407ab425f184..a6f7a9654e320 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -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 { + 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 { From 97227a34f53a758978fd63faf5dcf0dd2e9c4419 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 9 Aug 2023 13:16:07 +0200 Subject: [PATCH 3/3] Update graphql.go --- graphql/graphql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index a6f7a9654e320..7aa427b458bf7 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -568,7 +568,7 @@ func (t *Transaction) V(ctx context.Context) hexutil.Big { func (t *Transaction) YParity(ctx context.Context) (*hexutil.Uint64, error) { tx, _ := t.resolve(ctx) - if tx == nil { + if tx == nil || tx.Type() == types.LegacyTxType { return nil, nil } v, _, _ := tx.RawSignatureValues()