Exemple #1
1
 @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()));
   }
 }
Exemple #2
0
 /**
  * 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");
   }
 }