Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List ZBit (ZBT) - Reopen #3488

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 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,31 @@
/*
* 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
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");
}
}