Bläddra i källkod

BatchCall可以分别看到每一个错误

skyfffire 2 år sedan
förälder
incheckning
6eb88cef1c
1 ändrade filer med 6 tillägg och 3 borttagningar
  1. 6 3
      internal/ethapi/api.go

+ 6 - 3
internal/ethapi/api.go

@@ -1028,13 +1028,16 @@ 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 err != nil {
+		//	return nil, err
+		//}
 		// If the result contains a revert reason, try to unpack it.
 		if len(result.Revert()) > 0 {
 			result.Err = newRevertError(result)
+		} else {
+			result.Err = err
 		}
+
 		results = append(results, CallResult{Return: result.Return(), Error: result.Err})
 	}
 	return results, nil