示例#1
0
 @Override
 Fee getBaselineFee(Transaction transaction) {
   Attachment.MonetarySystemCurrencyIssuance attachment =
       (Attachment.MonetarySystemCurrencyIssuance) transaction.getAttachment();
   if (Currency.getCurrencyByCode(attachment.getCode()) != null
       || Currency.getCurrencyByCode(attachment.getName()) != null
       || Currency.getCurrencyByName(attachment.getName()) != null
       || Currency.getCurrencyByName(attachment.getCode()) != null) {
     return FIVE_LETTER_CURRENCY_ISSUANCE_FEE;
   }
   switch (Math.min(attachment.getCode().length(), attachment.getName().length())) {
     case 3:
       return THREE_LETTER_CURRENCY_ISSUANCE_FEE;
     case 4:
       return FOUR_LETTER_CURRENCY_ISSUANCE_FEE;
     case 5:
       return FIVE_LETTER_CURRENCY_ISSUANCE_FEE;
     default:
       // never, invalid code length will be checked and caught later
       return THREE_LETTER_CURRENCY_ISSUANCE_FEE;
   }
 }