|
|
@@ -1028,17 +1028,13 @@ func (s *PublicBlockChainAPI) BatchCall(ctx context.Context, config BatchCallCon
|
|
|
call.BlockOverrides.Apply(&blockContext)
|
|
|
}
|
|
|
result, err := doCall(ctx, s.b, call.CallArgs, state, header, timeout, gp, &blockContext)
|
|
|
- //if err != nil {
|
|
|
- // return nil, err
|
|
|
- //}
|
|
|
- // If the result contains a revert reason, try to unpack it.
|
|
|
- if err == nil && len(result.Revert()) > 0 {
|
|
|
+ if err != nil {
|
|
|
+ results = append(results, CallResult{Return: nil, Error: err})
|
|
|
+ } else if len(result.Revert()) > 0 { // If the result contains a revert reason, try to unpack it.
|
|
|
result.Err = newRevertError(result)
|
|
|
- } else {
|
|
|
- result.Err = err
|
|
|
- }
|
|
|
|
|
|
- results = append(results, CallResult{Return: nil, Error: result.Err})
|
|
|
+ results = append(results, CallResult{Return: result.Return(), Error: result.Err})
|
|
|
+ }
|
|
|
}
|
|
|
return results, nil
|
|
|
}
|