fix for Noir(NOR)

This commit is contained in:
flo071 2018-12-27 20:47:25 +01:00
parent 321ffc0c76
commit 71c891ca17
2 changed files with 16 additions and 4 deletions

View File

@ -22,6 +22,5 @@ import bisq.asset.RegexAddressValidator;
public class Noir extends Coin {
public Noir() {
super("Noir", "NOR", new DefaultAddressValidator());
super("Noir", "NOR", new RegexAddressValidator("^[Z][_A-z0-9]*([_A-z0-9])*$"));
}
}

View File

@ -1,4 +1,3 @@
/*
* This file is part of Bisq.
*
@ -25,6 +24,20 @@ import org.junit.Test;
public class NoirTest extends AbstractAssetWithDefaultValidatorTest {
public NoirTest() {
super("Noir", "NOR", new RegexAddressValidator("^[Z][_A-z0-9]*([_A-z0-9])*$"));
super(new Noir());
}
@Test
public void testValidAddresses() {
assertValidAddress("ZMZ6M64FiFjPjmzXRf7xBuyarorUmT8uyG");
assertValidAddress("ZHoMM3vccwGrAQocmmp9ZHA7Gjg9Uqkok7");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("");
assertInvalidAddress("21HQQgsvLTgN9xD9hNmAgAreakzVzQUSLSHa");
assertInvalidAddress("ZHoMM3vccwGrAQocmmp9ZHA7Gjg9Uqkok7*");
assertInvalidAddress("ZHoMM3vccwGrAQocmmp9ZHA7Gjg9Uqkok7#jHt5jtP");
}
}