diff --git a/assets/src/main/java/bisq/asset/coins/Bitzenyplus.java b/assets/src/main/java/bisq/asset/coins/Bitzenyplus.java new file mode 100644 index 00000000000..ffff23946fe --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Bitzenyplus.java @@ -0,0 +1,37 @@ +/* + * 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 . + */ + +package bisq.asset.coins; + +import bisq.asset.Base58BitcoinAddressValidator; +import bisq.asset.Coin; +import bisq.asset.NetworkParametersAdapter; + +public class Bitzenyplus extends Coin { + + public Bitzenyplus() { + super("Bitzenyplus", "D", new Base58BitcoinAddressValidator(new BitzenyplusMainNetParams()), Network.MAINNET); + } + + public static class BitzenyplusMainNetParams extends NetworkParametersAdapter { + public BitzenyplusMainNetParams() { + this.addressHeader = 81; + this.p2shHeader = 5; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; + } + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index c50ae587255..a4cdcf327e4 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -18,6 +18,7 @@ bisq.asset.coins.Bitcoin$Testnet bisq.asset.coins.BitDaric bisq.asset.coins.Bitmark bisq.asset.coins.Bitzec +bisq.asset.coins.Bitzenyplus bisq.asset.coins.Blur bisq.asset.coins.BSQ$Mainnet bisq.asset.coins.BSQ$Regtest diff --git a/assets/src/test/java/bisq/asset/coins/BitzenyplusTEST.java b/assets/src/test/java/bisq/asset/coins/BitzenyplusTEST.java new file mode 100644 index 00000000000..317bc5bb5ba --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/BitzenyplusTEST.java @@ -0,0 +1,43 @@ +/* + * 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 . + */ + +package bisq.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class BitzenyplusTest extends AbstractAssetTest { + + public BitzenyplusTest() { + super(new Bitzenyplus()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("ZryVTPGwpWMrWiqBhcje9NJJku3RgUmVrH"); + assertValidAddress("Zi6YRCx5y7MNQMseMecw5yquBCcXYvdvEL"); + assertValidAddress("3CB2kwzn245gaCSfkc7wbe2Myq2kDuQmpu"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("ZryVTPGwpWMrWiqBhcje9JJJku3RgUmVrMH"); + assertInvalidAddress("Zi6YRCx"); + assertInvalidAddress("3CB2kwzn245gaCSfkc7wbe2Myq2kDuQmpuu#"); + } +}