mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Merge branch 'Development' of https://github.com/WildCryptoICO/exchange into WildCryptoICO-Development
This commit is contained in:
commit
516d130a5c
@ -149,6 +149,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("WILD", "WILD Token", true));
|
||||
result.sort(TradeCurrency::compareTo);
|
||||
|
||||
// Util for printing all altcoins for adding to FAQ page
|
||||
|
@ -391,6 +391,12 @@ public final class AltCoinAddressValidator extends InputValidator {
|
||||
} catch (AddressFormatException e) {
|
||||
return new ValidationResult(false, getErrorMessage(e));
|
||||
}
|
||||
case "WILD":
|
||||
// https://github.com/ethereum/web3.js/blob/master/lib/utils/utils.js#L403
|
||||
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);
|
||||
|
@ -457,4 +457,18 @@ public class AltCoinAddressValidatorTest {
|
||||
assertFalse(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhek#").isValid);
|
||||
assertFalse(validator.validate("").isValid);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWILD() {
|
||||
AltCoinAddressValidator validator = new AltCoinAddressValidator();
|
||||
validator.setCurrencyCode("WILD");
|
||||
|
||||
assertTrue(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d164135398226").isValid);
|
||||
assertTrue(validator.validate("2a65Aca4D5fC5B5C859090a6c34d164135398226").isValid);
|
||||
|
||||
assertFalse(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266").isValid);
|
||||
assertFalse(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d16413539822g").isValid);
|
||||
assertFalse(validator.validate("2a65Aca4D5fC5B5C859090a6c34d16413539822g").isValid);
|
||||
assertFalse(validator.validate("").isValid);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user