From 7f89acd6dc95086fe52f9981e2290e7b2266824a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A6jontargaryen?= <34797913+aejontargaryen@users.noreply.github.com> Date: Fri, 27 Jul 2018 19:56:56 -0400 Subject: [PATCH 1/3] Update bisq.asset.Asset --- src/main/resources/META-INF/services/bisq.asset.Asset | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/META-INF/services/bisq.asset.Asset b/src/main/resources/META-INF/services/bisq.asset.Asset index ea8a817..e5906be 100644 --- a/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/src/main/resources/META-INF/services/bisq.asset.Asset @@ -43,6 +43,7 @@ bisq.asset.coins.Diamond bisq.asset.coins.DigiMoney bisq.asset.coins.Dinero bisq.asset.coins.Dogecoin +bisq.asset.coins.Dragonglass bisq.asset.coins.DRIP bisq.asset.coins.DSTRA bisq.asset.coins.DynamicCoin From 3aa42aaf42d4c75615a8a00bac69fa402bdf6f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A6jontargaryen?= <34797913+aejontargaryen@users.noreply.github.com> Date: Fri, 27 Jul 2018 19:58:02 -0400 Subject: [PATCH 2/3] Create Dragonglass.java --- .../java/bisq/asset/coins/Dragonglass.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/java/bisq/asset/coins/Dragonglass.java diff --git a/src/main/java/bisq/asset/coins/Dragonglass.java b/src/main/java/bisq/asset/coins/Dragonglass.java new file mode 100644 index 0000000..23c8391 --- /dev/null +++ b/src/main/java/bisq/asset/coins/Dragonglass.java @@ -0,0 +1,28 @@ +/* + * 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.Coin; +import bisq.asset.RegexAddressValidator; + +public class Dragonglass extends Coin { + + public Dragonglass() { + super("Dragonglass", "DRGL", new RegexAddressValidator("^(dRGL)[0-9A-Za-z]{94}$")); + } +} From 8b49fd0075e1dca8d93cdb7577cdf6a262a69ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A6jontargaryen?= <34797913+aejontargaryen@users.noreply.github.com> Date: Fri, 27 Jul 2018 19:59:11 -0400 Subject: [PATCH 3/3] Create DragonglassTest.java --- .../bisq/asset/coins/DragonglassTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/test/java/bisq/asset/coins/DragonglassTest.java diff --git a/src/test/java/bisq/asset/coins/DragonglassTest.java b/src/test/java/bisq/asset/coins/DragonglassTest.java new file mode 100644 index 0000000..036d219 --- /dev/null +++ b/src/test/java/bisq/asset/coins/DragonglassTest.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 DragonglassTest extends AbstractAssetTest { + + public DragonglassTest() { + super(new Dragonglass()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("dRGLhxvCtLk1vfSD3WmFzyTN5ph2gZYvkZfxvLSrcdry95x4PPJrCKBTKDEFZYTw4bCGqoiaUWxNd8B41vqXaTY72Vi2XcvikX"); + assertValidAddress("dRGLjS5v91tDd4GDZeahUj95nkXSNQs5DMY1YStLN2hSNWD67iZh7ED7oDw841Kx6oUYouZaXmBNFcqSptNZ4dL94CbZbF53jt"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("dRGLjS5v91tDd4GDZeahUj95nkXSNQs5DMY1YStLN2hSNWD67iZh7ED7oDw841Kx6oUYouZaXmBNFcqSptNZ4dL94CbZbF53j"); + assertInvalidAddress("dRGLjS5v91tDd4GDZeahUj95nkXSNQs5DMY1YStLN2hSNWD67iZh7ED7oDw841Ko6oUYouZaXmBNFcqSptNZ4dL94oUCifk4048"); + assertInvalidAddress("DRGLhxvCtLk1vfSD3WmFzyTN5ph2gZYvkZfxvLSrcdry95x4PPJrCKBTKDEFZYTw4bCGqoiaUWxNd8B41vqXaTY72Vi2XcvikX"); + assertInvalidAddress("drglhxvCtLk1vfSD3WmFzyTN5ph2gZYvkZfxvLSrcdry95x4PPJrCKBTKDEFZYTw4bCGqoiaUWxNd8B41vqXaTY72Vi2XcvikX"); + } +}