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
This commit is contained in:
Marius van der Wijden
2020-05-27 10:14:40 +02:00
committed by Péter Szilágyi
parent d77770d96e
commit 9f13c66fbd

View File

@ -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. //TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason.
return &CallResult{ return &CallResult{
data: result.Return(), data: result.ReturnData,
gasUsed: hexutil.Uint64(result.UsedGas), gasUsed: hexutil.Uint64(result.UsedGas),
status: status, status: status,
}, nil }, 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. //TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason.
return &CallResult{ return &CallResult{
data: result.Return(), data: result.ReturnData,
gasUsed: hexutil.Uint64(result.UsedGas), gasUsed: hexutil.Uint64(result.UsedGas),
status: status, status: status,
}, nil }, nil