Skip to content

Commit

Permalink
Merge pull request #2382 from lichuan/list-askcoin-asset
Browse files Browse the repository at this point in the history
List Askcoin (ASK)
  • Loading branch information
ripcurlx authored Feb 7, 2019
2 parents b172c9f + 38fcdf7 commit f4bf209
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
28 changes: 28 additions & 0 deletions assets/src/main/java/bisq/asset/coins/Askcoin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.Coin;
import bisq.asset.RegexAddressValidator;

public class Askcoin extends Coin {

public Askcoin() {
super("Askcoin", "ASK", new RegexAddressValidator("^[1-9][0-9]{0,11}"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
bisq.asset.coins.Actinium
bisq.asset.coins.Adeptio
bisq.asset.coins.Aeon
bisq.asset.coins.Askcoin
bisq.asset.coins.Australiacash
bisq.asset.coins.Beam
bisq.asset.coins.Bitcoin$Mainnet
Expand Down
48 changes: 48 additions & 0 deletions assets/src/test/java/bisq/asset/coins/AskcoinTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class AskcoinTest extends AbstractAssetTest {

public AskcoinTest() {
super(new Askcoin());
}

@Test
public void testValidAddresses() {
assertValidAddress("1");
assertValidAddress("123");
assertValidAddress("876982302333");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("0");
assertInvalidAddress("038292");
assertInvalidAddress("");
assertInvalidAddress("000232320382");
assertInvalidAddress("1298934567890");
assertInvalidAddress("123abc5ab");
assertInvalidAddress("null");
assertInvalidAddress("xidjfwi23ii0");
}
}

0 comments on commit f4bf209

Please sign in to comment.