From 250fa3e8d73948afe9664c573ca74a1773d486b0 Mon Sep 17 00:00:00 2001 From: farsider350 <31876349+farsider350@users.noreply.github.com> Date: Thu, 11 Apr 2019 21:56:59 +1000 Subject: [PATCH] List Genix (GENIX) List Genix (GENIX) Author: farsider350 farsider350@protonmail.com Date: Thu April 11 22:00 GMT+1000 List Genix (GENIX) Official project URL: https://genix.cx Official block explorer URL: http://explorer.genix.cx --- .../src/main/java/bisq/asset/coins/Genix.java | 36 ++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../test/java/bisq/asset/coins/GenixTest.java | 43 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Genix.java create mode 100644 assets/src/test/java/bisq/asset/coins/GenixTest.java 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..0de5fa73c14 --- /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}; + } + } +} 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 5a141f856f6..f67cbbbf3ec 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -43,6 +43,7 @@ bisq.asset.coins.FourtyTwo bisq.asset.coins.Fujicoin bisq.asset.coins.Galilel bisq.asset.coins.GambleCoin +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..a299c1567c9 --- /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#"); + } +}