|
|
@@ -972,7 +972,8 @@ type BatchCallArgs struct {
|
|
|
// CallResult is the result of one call.
|
|
|
type CallResult struct {
|
|
|
Return hexutil.Bytes
|
|
|
- Error string
|
|
|
+ Msg string
|
|
|
+ Code int8
|
|
|
}
|
|
|
|
|
|
// BlockChainAPI provides an API to access Ethereum blockchain data.
|
|
|
@@ -1031,9 +1032,9 @@ func (s *PublicBlockChainAPI) BatchCall(ctx context.Context, config BatchCallCon
|
|
|
result, err := doCall(ctx, s.b, call.CallArgs, state, header, timeout, gp, &blockContext)
|
|
|
if err != nil {
|
|
|
fmt.Fprintf(os.Stderr, "call execution reverted: %v\n\n", err)
|
|
|
- results = append(results, CallResult{Return: nil, Error: err.Error()})
|
|
|
+ results = append(results, CallResult{Code: 0, Return: nil, Msg: err.Error()})
|
|
|
} else {
|
|
|
- results = append(results, CallResult{Return: result.Return(), Error: ""})
|
|
|
+ results = append(results, CallResult{Code: 1, Return: result.Return(), Msg: "Success."})
|
|
|
}
|
|
|
}
|
|
|
return results, nil
|