From 026a41757d444c2ed3aa2e1c031eeba3ee5b35af Mon Sep 17 00:00:00 2001 From: wowario Date: Thu, 10 May 2018 17:49:07 +0300 Subject: [PATCH] list-wow --- src/main/java/bisq/asset/coins/Wownero.java | 28 ++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/WowneroTest.java | 43 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 src/main/java/bisq/asset/coins/Wownero.java create mode 100644 src/test/java/bisq/asset/coins/WowneroTest.java diff --git a/src/main/java/bisq/asset/coins/Wownero.java b/src/main/java/bisq/asset/coins/Wownero.java new file mode 100644 index 0000000..b14c775 --- /dev/null +++ b/src/main/java/bisq/asset/coins/Wownero.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 Wownero extends Coin { + + public Wownero() { + super("Wownero", "WOW", new RegexAddressValidator("^(Wo)\\d[0-9A-Za-z]{94}$")); + } +} diff --git a/src/main/resources/META-INF/services/bisq.asset.Asset b/src/main/resources/META-INF/services/bisq.asset.Asset index d3e60ae..126e5af 100644 --- a/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/src/main/resources/META-INF/services/bisq.asset.Asset @@ -94,6 +94,7 @@ bisq.asset.coins.Unobtanium bisq.asset.coins.VDinar bisq.asset.coins.Wacoin bisq.asset.coins.WorldMobileCoin +bisq.asset.coins.Wownero bisq.asset.coins.Xuez bisq.asset.coins.Yenten bisq.asset.coins.Zcash diff --git a/src/test/java/bisq/asset/coins/WowneroTest.java b/src/test/java/bisq/asset/coins/WowneroTest.java new file mode 100644 index 0000000..9a0d316 --- /dev/null +++ b/src/test/java/bisq/asset/coins/WowneroTest.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 WowneroTest extends AbstractAssetTest { + + public WowneroTest() { + super(new Wownero()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("Wo3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP"); + assertValidAddress("Wo4hqQ2xftk9UNDThFPWcQ4VtgC4Ciz7ES3XQ81qdfYjXe17kUxPSGGWwisoxYvZb5Y36DpGVKVLZXHhwjwB7TZr1evyvgMg2"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("Wo3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94"); + assertInvalidAddress("Wo3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP69"); + assertInvalidAddress("694hqQ2xftk9UNDThFPWcQ4VtgC4Ciz7ES3XQ81qdfYjXe17kUxPSGGWwisoxYvZb5Y36DpGVKVLZXHhwjwB7TZr1evyvgMg2"); + assertInvalidAddress("W14hqQ2xftk9UNDThFPWcQ4VtgC4Ciz7ES3XQ81qdfYjXe17kUxPSGGWwisoxYvZb5Y36DpGVKVLZXHhwjwB7TZr1evyvgMg2"); + } +}