File tree Expand file tree Collapse file tree
framework/src/main/java/org/tron/core/services/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -554,6 +554,7 @@ public static List<Log> convertLogAddressToTronAddress(TransactionInfo transacti
554554 * Validate parameters for trigger constant and estimate energy
555555 * - Rule-1: owner address must be set
556556 * - Rule-2: either contract address is set or call data is set
557+ * - Rule-3: if try to deploy, function selector and call data can not be both set
557558 * @param contract parameters in json format
558559 * @throws InvalidParameterException if validation is not passed, this kind of exception is thrown
559560 */
@@ -567,6 +568,12 @@ public static void validateParameter(String contract) throws InvalidParameterExc
567568 throw new InvalidParameterException ("At least one of "
568569 + CONTRACT_ADDRESS + " and " + CALL_DATA + " must be set." );
569570 }
571+ if (StringUtils .isEmpty (jsonObject .getString (CONTRACT_ADDRESS ))
572+ && !StringUtils .isEmpty (jsonObject .getString (FUNCTION_SELECTOR ))
573+ && !StringUtils .isEmpty (jsonObject .getString (CALL_DATA ))) {
574+ throw new InvalidParameterException ("While trying to deploy, "
575+ + FUNCTION_SELECTOR + " and " + CALL_DATA + " can not be both set." );
576+ }
570577 }
571578
572579}
You can’t perform that action at this time.
0 commit comments