From ca35628cc2bc752e6fbef722799e1704ac73d250 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Tue, 26 May 2020 10:20:24 +0200 Subject: [PATCH] graphql: removed revert logic until spec change --- graphql/graphql.go | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index 548000271c..446242aa67 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -23,7 +23,6 @@ import ( "time" "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/rawdb" @@ -812,16 +811,9 @@ func (b *Block) Call(ctx context.Context, args struct { if result.Failed() { status = 0 } - data := result.Return() - // If the result contains a revert reason, try to unpack and return it. - if len(result.Revert()) > 0 { - reason, err := abi.UnpackRevert(result.Revert()) - if err == nil { - data = []byte(reason) - } - } + //TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason. return &CallResult{ - data: data, + data: result.Return(), gasUsed: hexutil.Uint64(result.UsedGas), status: status, }, nil @@ -889,16 +881,9 @@ func (p *Pending) Call(ctx context.Context, args struct { if result.Failed() { status = 0 } - data := result.Return() - // If the result contains a revert reason, try to unpack and return it. - if len(result.Revert()) > 0 { - reason, err := abi.UnpackRevert(result.Revert()) - if err == nil { - data = []byte(reason) - } - } + //TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason. return &CallResult{ - data: data, + data: result.Return(), gasUsed: hexutil.Uint64(result.UsedGas), status: status, }, nil