From c144f01a0e2f871db247e0d2e859a0c91ec9dcda Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Fri, 17 Dec 2021 13:38:39 +0330 Subject: [PATCH 1/2] graphql: fix pre-byzantium tx status --- graphql/graphql.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index e92f1126f66b..2c71eb2ecda4 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -372,8 +372,11 @@ func (t *Transaction) Status(ctx context.Context) (*Long, error) { if err != nil || receipt == nil { return nil, err } - ret := Long(receipt.Status) - return &ret, nil + var ret *Long + if len(receipt.PostState) == 0 { + *ret = Long(receipt.Status) + } + return ret, nil } func (t *Transaction) GasUsed(ctx context.Context) (*Long, error) { From e2a64497abbd8401f9e7f06fac41b79d6ed70fa3 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Tue, 4 Jan 2022 10:12:31 +0100 Subject: [PATCH 2/2] minor fix --- graphql/graphql.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index 2c71eb2ecda4..fff30d71f0ba 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -372,11 +372,11 @@ func (t *Transaction) Status(ctx context.Context) (*Long, error) { if err != nil || receipt == nil { return nil, err } - var ret *Long - if len(receipt.PostState) == 0 { - *ret = Long(receipt.Status) + if len(receipt.PostState) != 0 { + return nil, nil } - return ret, nil + ret := Long(receipt.Status) + return &ret, nil } func (t *Transaction) GasUsed(ctx context.Context) (*Long, error) {