Skip to content

Commit

Permalink
List SixEleven (611) update AddressValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
fflo committed Jun 17, 2019
1 parent de38b21 commit f0506fe
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
12 changes: 10 additions & 2 deletions assets/src/main/java/bisq/asset/coins/SixEleven.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@

package bisq.asset.coins;

import bisq.asset.Base58BitcoinAddressValidator;
import bisq.asset.Coin;
import bisq.asset.DefaultAddressValidator;
import bisq.asset.NetworkParametersAdapter;

public class SixEleven extends Coin {

public SixEleven() {
super("SixEleven", "611", new DefaultAddressValidator());
super("SixEleven", "611", new Base58BitcoinAddressValidator(new SixElevenChainParams()));
}

public static class SixElevenChainParams extends NetworkParametersAdapter {
public SixElevenChainParams() {
addressHeader = 52;
acceptableAddressCodes = new int[]{addressHeader};
}
}
}
21 changes: 19 additions & 2 deletions assets/src/test/java/bisq/asset/coins/SixElevenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,28 @@

package bisq.asset.coins;

import bisq.asset.AbstractAssetWithDefaultValidatorTest;
import org.junit.Test;
import bisq.asset.AbstractAssetTest;

public class SixElevenTest extends AbstractAssetWithDefaultValidatorTest {
public class SixElevenTest extends AbstractAssetTest {

public SixElevenTest() {
super(new SixEleven());
}

@Test
public void testValidAddresses() {
assertValidAddress("N7yhcPhzFduWXPc11AUK9zvtnsL6sgxmRs");
assertValidAddress("N22FRU9f3fx7Hty641D5cg95kRK6S3sbf3");
assertValidAddress("MxmFPEPzF19JFPU3VPrRXvUbPjMQXnQerY");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("N7yhcPhzFduWXPc11AUK9zvtnsL6sgxmRsx");
assertInvalidAddress("MxmFPEPzF19JFPU3VPrRXvUbPjMQXnQer");
assertInvalidAddress("bc1qus65zpte6qa2408qu3540lfcyj9cx7dphfcspn");
assertInvalidAddress("3GyEtTwXhxbjBtmAR3CtzeayAyshtvd44P");
assertInvalidAddress("1CnXYrivw7pJy3asKftp41wRPgBggF9fBw");
}
}

0 comments on commit f0506fe

Please sign in to comment.