diff --git a/assets/src/main/java/bisq/asset/coins/Genix.java b/assets/src/main/java/bisq/asset/coins/Genix.java new file mode 100644 index 00000000000..3332cb95828 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Genix.java @@ -0,0 +1,36 @@ +/* + * 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 Genix extends Coin { + public Genix() { + super("Genix", "GENIX", new Base58BitcoinAddressValidator(new GenixParams())); + } + public static class GenixParams extends NetworkParametersAdapter { + + public GenixParams() { + addressHeader = 38; + p2shHeader = 13; + acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; + } + } + } \ No newline at end of file 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..8824b754c77 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -51,6 +51,7 @@ bisq.asset.coins.Fujicoin bisq.asset.coins.Galilel bisq.asset.coins.GambleCoin bisq.asset.coins.Genesis +bisq.asset.coins.Genix bisq.asset.coins.Grin bisq.asset.coins.Hatch bisq.asset.coins.Helium diff --git a/assets/src/test/java/bisq/asset/coins/GenixTest.java b/assets/src/test/java/bisq/asset/coins/GenixTest.java new file mode 100644 index 00000000000..c6a47c3e68f --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/GenixTest.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 GenixTest extends AbstractAssetTest { + + public GenixTest() { + super(new Genix()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("GZr9jrPWZHdexAZtp4VDYu784dLBpfShJB"); + assertValidAddress("Gdj1Her8PQzhTMek3NR5RWkHiMEwQHmZTK"); + assertValidAddress("GSEqrQGwcd7FPqWe3oBjcguTSUFgnDo71A"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("1GZr9jrPWZHdexAZtp4VDYu784dLBpfShJB"); + assertInvalidAddress("GZr9jrPWZHdextAZtp4VDYu784dLBpfShJB"); + assertInvalidAddress("GSEqrQGwcd7FPqWe3oBjcguTSUFgnDo71A#"); + } +} \ No newline at end of file