Skip to content

Commit

Permalink
use latest validator class
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew K committed Nov 8, 2018
1 parent 9513516 commit 51867e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
13 changes: 11 additions & 2 deletions assets/src/main/java/bisq/asset/coins/Bitmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@
package bisq.asset.coins;

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

public class Bitmark extends Coin {

public static class BitmarkParams extends NetworkParametersAdapter {
public BitmarkParams() {
addressHeader = 85;
p2shHeader = 5;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}

public Bitmark() {
super("Bitmark", "BTM", new DefaultAddressValidator());
super("Bitmark", "BTM", new Base58BitcoinAddressValidator(new BitmarkParams()));
}
}
18 changes: 16 additions & 2 deletions assets/src/test/java/bisq/asset/coins/BitmarkTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@

package bisq.asset.coins;

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

public class BitmarkTest extends AbstractAssetWithDefaultValidatorTest {
public class BitmarkTest extends AbstractAssetTest {

public BitmarkTest() {
super(new Bitmark());
}

@Test
public void testValidAddresses() {
assertValidAddress("bMigVohTEiA3gxhFWpDJBrZ14j2RnDkWCs");
assertValidAddress("bKMivcHXMNfs3P3AaTtyhDiZ7s8Nw3ek6L");
assertValidAddress("bXUYGzbV8v6pLZtkYDL3feyrRFFnc37e3H");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("bMigVohTEiA3gxhFWpDJBrZ14j2RnDkWCt");
assertInvalidAddress("F9z7PKmo1sLQYtFuZjTQ1zZXhPQtHLScKT");
assertInvalidAddress("16Ftsh4Ff2ijPNsnQAUf5fKTp7DJaGxSZK");
}
}

0 comments on commit 51867e9

Please sign in to comment.