mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
commit
2f04d1ca89
@ -102,6 +102,7 @@ public class CurrencyUtil {
|
||||
result.add(new CryptoCurrency("XCP", "Counterparty"));
|
||||
result.add(new CryptoCurrency("CREA", "Creativecoin"));
|
||||
result.add(new CryptoCurrency("XCN", "Cryptonite"));
|
||||
result.add(new CryptoCurrency("DAI", "Dai Stablecoin", true));
|
||||
result.add(new CryptoCurrency("DNET", "DarkNet"));
|
||||
if (!baseCurrencyCode.equals("DASH"))
|
||||
result.add(new CryptoCurrency("DASH", "Dash"));
|
||||
|
@ -251,6 +251,7 @@ public class TradeStatisticsManager {
|
||||
newlyAdded.add("BETR");
|
||||
newlyAdded.add("MVT");
|
||||
newlyAdded.add("REF");
|
||||
newlyAdded.add("DAI");
|
||||
|
||||
|
||||
coinsWithValidator.addAll(newlyAdded);
|
||||
|
@ -196,6 +196,12 @@ public final class AltCoinAddressValidator extends InputValidator {
|
||||
return regexTestFailed;
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
case "DAI":
|
||||
// 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);
|
||||
case "PIVX":
|
||||
if (input.matches("^[D][a-km-zA-HJ-NP-Z1-9]{25,34}$")) {
|
||||
//noinspection ConstantConditions
|
||||
|
@ -128,6 +128,20 @@ public class AltCoinAddressValidatorTest {
|
||||
assertFalse(validator.validate("").isValid);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDAI() {
|
||||
AltCoinAddressValidator validator = new AltCoinAddressValidator();
|
||||
validator.setCurrencyCode("DAI");
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPIVX() {
|
||||
AltCoinAddressValidator validator = new AltCoinAddressValidator();
|
||||
|
Loading…
Reference in New Issue
Block a user