mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Merge branch 'master' of https://github.com/ibininja/exchange into ibininja-master
This commit is contained in:
commit
3c0082aee5
@ -146,7 +146,7 @@ public class CurrencyUtil {
|
||||
result.add(new CryptoCurrency("XZC", "Zcoin"));
|
||||
result.add(new CryptoCurrency("ZEC", "Zcash"));
|
||||
result.add(new CryptoCurrency("ZEN", "ZenCash"));
|
||||
|
||||
result.add(new CryptoCurrency("CRED", "Verify", true));
|
||||
result.sort(TradeCurrency::compareTo);
|
||||
|
||||
// Util for printing all altcoins for adding to FAQ page
|
||||
|
@ -367,6 +367,11 @@ public final class AltCoinAddressValidator extends InputValidator {
|
||||
} catch (AddressFormatException e) {
|
||||
return new ValidationResult(false, getErrorMessage(e));
|
||||
}
|
||||
case "CRED":
|
||||
if (!input.matches("^(0x)?[0-9a-fA-F]{40}$"))
|
||||
return regexTestFailed;
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
// Add new coins at the end...
|
||||
default:
|
||||
log.debug("Validation for AltCoinAddress not implemented yet. currencyCode: " + currencyCode);
|
||||
|
@ -412,4 +412,18 @@ public class AltCoinAddressValidatorTest {
|
||||
assertFalse(validator.validate("1HQQgsvLTgN9xD9hNmAgAreakzVzQUSLSH#").isValid);
|
||||
assertFalse(validator.validate("").isValid);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCRED() {
|
||||
AltCoinAddressValidator validator = new AltCoinAddressValidator();
|
||||
validator.setCurrencyCode("CRED");
|
||||
|
||||
assertTrue(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a21").isValid);
|
||||
assertTrue(validator.validate("65767ec6d4d3d18a200842352485cdc37cbf3a21").isValid);
|
||||
|
||||
assertFalse(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a216").isValid);
|
||||
assertFalse(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a2g").isValid);
|
||||
assertFalse(validator.validate("65767ec6d4d3d18a200842352485cdc37cbf3a2g").isValid);
|
||||
assertFalse(validator.validate("").isValid);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user