From 9f13c66fbd66013ea1ecacdeb195ba48401672c2 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Wed, 27 May 2020 10:14:40 +0200 Subject: [PATCH] graphql: use returndata instead of return Return() checks if there is an error. If an error is found, we return nil. For most use cases it can be beneficial to return the output even if there was an error. This code should be changed anyway once the spec supports error reasons in graphql responses --- graphql/graphql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index 446242aa67..17a1868a1e 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -813,7 +813,7 @@ func (b *Block) Call(ctx context.Context, args struct { } //TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason. return &CallResult{ - data: result.Return(), + data: result.ReturnData, gasUsed: hexutil.Uint64(result.UsedGas), status: status, }, nil @@ -883,7 +883,7 @@ func (p *Pending) Call(ctx context.Context, args struct { } //TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason. return &CallResult{ - data: result.Return(), + data: result.ReturnData, gasUsed: hexutil.Uint64(result.UsedGas), status: status, }, nil