@Override void validateAttachment(Transaction transaction) throws NxtException.ValidationException { Attachment.MonetarySystemCurrencyDeletion attachment = (Attachment.MonetarySystemCurrencyDeletion) transaction.getAttachment(); Currency currency = Currency.getCurrency(attachment.getCurrencyId()); CurrencyType.validate(currency, transaction); if (!currency.canBeDeletedBy(transaction.getSenderId())) { throw new NxtException.NotCurrentlyValidException( "Currency " + Long.toUnsignedString(currency.getId()) + " cannot be deleted by account " + Long.toUnsignedString(transaction.getSenderId())); } }
/** * Gets the ID of the specified currency. * * @param currency * @return The ID of the specified currency. */ public static String getCurrencyId(String currency) { if (Currency.physicalExists(currency)) { return Currency.getId(currency); } else { throw new NoCurrencyException( "MCCom: public static String getCurrencyId(String currency)", "currency"); } }