addError(Errors.FAILED_CHECK, "Environment should be not null"); return checkResult; addError(Errors.FAILED_CHECK, "definition.extended_type", "illegal value, should be " + SmartContractType.SLOT1.name() + " instead " + getExtendedType()); return checkResult; addError(Errors.FAILED_CHECK, "Tracking contract is missed"); return checkResult; checkResult = getTrackingContract().getOrigin().equals(tc.getOrigin()); if (!checkResult) { addError(Errors.FAILED_CHECK, "Slot-contract should store only contracts with same origin"); return checkResult;
if(paidU == 0) { if(getPaidU(true) > 0) { addError(Errors.FAILED_CHECK, "Test payment is not allowed for storing contracts in slots"); addError(Errors.FAILED_CHECK, "Payment for slot contract is below minimum level of " + getMinPayment() + "U"); checkResult = false; addError(Errors.FAILED_CHECK, "Slot contract hasn't valid payment"); return checkResult; addError(Errors.FAILED_CHECK, "Wrong [state.data." + PREPAID_KD_FIELD_NAME + "] value. " + "Should be sum of early paid U and paid U by current revision."); return checkResult; addError(Errors.FAILED_CHECK, "Slot-contract signing keys must has allowed keys for owner of tracking contract"); return checkResult;
@Override public boolean beforeUpdate(ImmutableEnvironment c) { boolean checkResult = false; // recalculate storing info without saving to state to get valid storing data calculatePrepaidKilobytesForDays(false); // check that payment was not hacked checkResult = prepaidKilobytesForDays == getStateData().getInt(PREPAID_KD_FIELD_NAME, 0); if(!checkResult) { addError(Errors.FAILED_CHECK, "Wrong [state.data." + PREPAID_KD_FIELD_NAME + "] value. " + "Should be sum of early paid U and paid U by current revision."); return checkResult; } if(getTrackingContract() != null) { // check for that last revision of tracking contract has same owner as creator of slot checkResult = getTrackingContract().getOwner().isAllowedForKeys(getEffectiveKeys()); if (!checkResult) { addError(Errors.FAILED_CHECK, "Slot-contract signing keys must has allowed keys for owner of tracking contract"); return checkResult; } } // and call common slot check checkResult = additionallySlotCheck(c); return checkResult; }