From 2450d9b16c2580d80ffd7443ac16cf39adfa35cd Mon Sep 17 00:00:00 2001 From: GM Date: Tue, 3 Sep 2019 12:51:30 +0100 Subject: [PATCH] List Krypton (ZOD) --- .../main/java/bisq/asset/coins/Krypton.java | 28 +++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/KryptonTest.java | 48 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Krypton.java create mode 100644 assets/src/test/java/bisq/asset/coins/KryptonTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Krypton.java b/assets/src/main/java/bisq/asset/coins/Krypton.java new file mode 100644 index 00000000000..1e8e0770379 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Krypton.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 Krypton extends Coin { + + public Krypton() { + super("Krypton", "ZOD", new RegexAddressValidator("^QQQ[1-9A-Za-z^OIl]{95}")); + } +} 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 69e7b11d763..6a0dccdbed4 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -57,6 +57,7 @@ bisq.asset.coins.Iridium bisq.asset.coins.Kekcoin bisq.asset.coins.KnowYourDeveloper bisq.asset.coins.Kore +bisq.asset.coins.Krypton bisq.asset.coins.Litecoin bisq.asset.coins.LitecoinPlus bisq.asset.coins.LitecoinZ diff --git a/assets/src/test/java/bisq/asset/coins/KryptonTest.java b/assets/src/test/java/bisq/asset/coins/KryptonTest.java new file mode 100644 index 00000000000..1ac55127a79 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/KryptonTest.java @@ -0,0 +1,48 @@ +/* + * 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 KryptonTest extends AbstractAssetTest { + + public KryptonTest() { + super(new Krypton()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("QQQ1LgQ1m8vX5tGrBZ2miS7A54Fmj5Qbij4UXT8nD4aqF75b1cpAauxVkjYaefcztV62UrDT1K9WHDeQWu4vpVXU2wezpshvex"); + assertValidAddress("QQQ1G56SKneSK1833tKjLH7E4ZgFwnqhqUb1HMHgYbnhaST56mukM1296jiYjTyTdMWnvH5FpWNAJWaQqwyPJHUR8qXRKBJy9o"); + assertValidAddress("QQQ1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8UzsaJ"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("QQQ1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8"); + assertInvalidAddress("11QQQ1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8UzsaJ"); + assertInvalidAddress(""); + assertInvalidAddress("#RoUKWRwpsx1F"); + assertInvalidAddress("YQQ1G56SKneSK1833tKjLH7E4ZgFwnqhqUb1HMHgYbnhaST56mukM1296jiYjTyTdMWnvH5FpWNAJWaQqwyPJHUR8qXRKBJy9o"); + assertInvalidAddress("3jyRo3rcp9fjdfjdSGpx"); + assertInvalidAddress("QQQ1G56SKneSK1833tKjLH7E4ZgFwnqhqUb1HMHgYbnhaST56mukM1296jiYjTyTdMWnvH5FpWNAJWaQqwyPJHUR8qXRKBJy9#"); + assertInvalidAddress("ZOD1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8UzsaJ"); + } +} \ No newline at end of file