Эх сурвалжийг харах

修复正确结果没有返回的问题

skyfffire 2 жил өмнө
parent
commit
6b3917bb3f

+ 4 - 2
internal/ethapi/api.go

@@ -1030,8 +1030,10 @@ 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 {
 			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 {
+			if len(result.Revert()) > 0 { // If the result contains a revert reason, try to unpack it.
+				result.Err = newRevertError(result)
+			}
 
 			results = append(results, CallResult{Return: result.Return(), Error: result.Err})
 		}