graphql: removed revert logic until spec change
This commit is contained in:
parent
7b6fbcadc3
commit
ca35628cc2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue