graphql: removed revert logic until spec change

This commit is contained in:
Marius van der Wijden 2020-05-26 10:20:24 +02:00 committed by Péter Szilágyi
parent 7b6fbcadc3
commit ca35628cc2
No known key found for this signature in database
GPG Key ID: E9AE538CEDF8293D
1 changed files with 4 additions and 19 deletions

View File

@ -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