graphql: removed revert logic until spec change
This commit is contained in:
committed by
Péter Szilágyi
parent
7b6fbcadc3
commit
ca35628cc2
@ -23,7 +23,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum"
|
"github.com/ethereum/go-ethereum"
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||||
@ -812,16 +811,9 @@ func (b *Block) Call(ctx context.Context, args struct {
|
|||||||
if result.Failed() {
|
if result.Failed() {
|
||||||
status = 0
|
status = 0
|
||||||
}
|
}
|
||||||
data := result.Return()
|
//TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason.
|
||||||
// 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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &CallResult{
|
return &CallResult{
|
||||||
data: data,
|
data: result.Return(),
|
||||||
gasUsed: hexutil.Uint64(result.UsedGas),
|
gasUsed: hexutil.Uint64(result.UsedGas),
|
||||||
status: status,
|
status: status,
|
||||||
}, nil
|
}, nil
|
||||||
@ -889,16 +881,9 @@ func (p *Pending) Call(ctx context.Context, args struct {
|
|||||||
if result.Failed() {
|
if result.Failed() {
|
||||||
status = 0
|
status = 0
|
||||||
}
|
}
|
||||||
data := result.Return()
|
//TODO(rjl493456442, MariusVanDerWijden) return revert reason here once the spec supports an error reason.
|
||||||
// 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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &CallResult{
|
return &CallResult{
|
||||||
data: data,
|
data: result.Return(),
|
||||||
gasUsed: hexutil.Uint64(result.UsedGas),
|
gasUsed: hexutil.Uint64(result.UsedGas),
|
||||||
status: status,
|
status: status,
|
||||||
}, nil
|
}, nil
|
||||||
|
Reference in New Issue
Block a user