Skip to content

Commit

Permalink
List ZBit (ZBT)
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriDaria authored and Owlkaline committed Oct 27, 2019
1 parent 2967702 commit 33813d6
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
38 changes: 38 additions & 0 deletions assets/src/main/java/bisq/asset/coins/ZBit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.AltCoinAccountDisclaimer;
import bisq.asset.Coin;
import bisq.asset.I18n;
import bisq.asset.RegexAddressValidator;

@AltCoinAccountDisclaimer("account.altcoin.popup.ZBT.msg")
public class ZBit extends Coin {

public ZBit() {
super("ZBit", "ZBT", new ZbtAddressValidator());
}

public static class ZbtAddressValidator extends RegexAddressValidator {

public ZbtAddressValidator() {
super("^a?[a-zA-Z0-9]{33}", I18n.DISPLAY_STRINGS.getString("account.altcoin.popup.validation.ZBT"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ bisq.asset.coins.Webchain
bisq.asset.coins.WORX
bisq.asset.coins.WrkzCoin
bisq.asset.coins.XDR
bisq.asset.coins.ZBit
bisq.asset.coins.Zcash
bisq.asset.coins.Zcoin
bisq.asset.coins.ZelCash
Expand Down
41 changes: 41 additions & 0 deletions assets/src/test/java/bisq/asset/coins/ZBitTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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;

public class ZBitTest extends AbstractAssetTest {

public ZBitTest() {
super(new ZBit());
}

@Override
public void testValidAddresses() {
assertValidAddress("8Hu897ivzmeFuLNB6956X6gyGeVNHUBRgD");
assertValidAddress("81HwTdCmQV3NspP2QqCGpehoFpi8NY4Zg3");
assertValidAddress("8Hu897ivzmeFuLNB6956X6gyGeVNHUBRgD");
}

@Override
public void testInvalidAddresses() {
assertInvalidAddress("MxmFPEPzF19JFPU3VPrRXvUbPjMQXnQerY");
assertInvalidAddress("N22FRU9f3fx7Hty641D5cg95kRK6S3sbf3");
assertInvalidAddress("MxmFPEPzF19JFPU3VPrRXvUbPjMQXnQerY");
}
}

0 comments on commit 33813d6

Please sign in to comment.