Skip to content

Commit

Permalink
List ZBit (ZBT)
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriDaria committed Nov 5, 2019
1 parent 2967702 commit 57a5cd5
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
30 changes: 30 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,30 @@
/*
* 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 RegexAddressValidator("^8[a-zA-Z0-9]{33}"));
}
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ account.altcoin.popup.validation.ETC=ETC address must start with '0x' and made u
account.altcoin.popup.validation.NMC=NMC address must start with 'N' or 'M' and must be 34 characters long.
account.altcoin.popup.validation.SF= Siafund address must be made up of letters A to F and numbers which are 76 characters long.
account.altcoin.popup.validation.UNO=UNO address must start with 'u' and must have 34 characters.
account.altcoin.popup.validation.XZC=XZC address must start with 'a' and must have 34 characters.
account.altcoin.popup.validation.XZC=XZC address must start with 'a' and must have 34 characters.
account.altcoin.popup.validation.ZBT=ZBT address must start with '8' and must have 34 characters.
49 changes: 49 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,49 @@
/*
* 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 ZBitTest extends AbstractAssetTest {

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

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

@Test
public void testInvalidAddresses() {
assertInvalidAddress("");
assertInvalidAddress("8");
assertInvalidAddress("822FRU9f3fx7Hty641D5cg95kRK6sH0rT");
assertInvalidAddress("822FRU9f3fx7Hty641D5cg95kRK6S3sbfISTOOLONG");

assertInvalidAddress("MHu897ivzmeFuLNB6956X6gyGfhj676784");
assertInvalidAddress("M");
assertInvalidAddress("M22FRU9f3fx7Hty641D5cg95kRK6sH0rT");
assertInvalidAddress("M22FRU9f3fx7Hty641D5cg95kRK6S3sbfISTOOLONG");
}
}

0 comments on commit 57a5cd5

Please sign in to comment.