Merge branch 'list-betr-token' of https://github.com/BetterBetting/exchange-bisq-network into BetterBetting-list-betr-token

This commit is contained in:
Manfred Karrer 2018-01-28 19:08:49 -05:00
commit 20fd6a706e
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
3 changed files with 21 additions and 0 deletions

View File

@ -94,6 +94,7 @@ public class CurrencyUtil {
result.add(new CryptoCurrency("BTC", "Bitcoin"));
result.add(new CryptoCurrency("BCH", "Bitcoin Cash"));
result.add(new CryptoCurrency("BCHC", "Bitcoin Clashic"));
result.add(new CryptoCurrency("BETR", "Better Betting", true));
result.add(new CryptoCurrency("BTG", "Bitcoin Gold"));
result.add(new CryptoCurrency("BURST", "Burstcoin"));
result.add(new CryptoCurrency("GBYTE", "Byte"));

View File

@ -416,6 +416,12 @@ public final class AltCoinAddressValidator extends InputValidator {
return regexTestFailed;
else
return new ValidationResult(true);
case "BETR":
// 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:

View File

@ -525,4 +525,18 @@ public class AltCoinAddressValidatorTest {
assertFalse(validator.validate("XIN-FXFA-LR6Y-QZA-9V4SX").isValid);
assertFalse(validator.validate("XIN-FXFA-LR6Y-QZAW-9V4S").isValid);
}
@Test
public void testBETR() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("BETR");
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);
}
}