From 148585239bf972dae4b702cbfa793eb57cb16b79 Mon Sep 17 00:00:00 2001 From: carsenk Date: Wed, 20 Nov 2019 18:28:44 -0700 Subject: [PATCH 1/2] List Denarius (D) --- .../main/java/bisq/asset/coins/Denarius.java | 37 ++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/DenariusTest.java | 43 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Denarius.java create mode 100644 assets/src/test/java/bisq/asset/coins/DenariusTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Denarius.java b/assets/src/main/java/bisq/asset/coins/Denarius.java new file mode 100644 index 00000000000..90a70051e2e --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Denarius.java @@ -0,0 +1,37 @@ +/* + * 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 Denarius extends Coin { + + public Denarius() { + super("Denarius", "D", new Base58BitcoinAddressValidator(new DenariusMainNetParams()), Network.MAINNET); + } + + public static class DenariusMainNetParams extends NetworkParametersAdapter { + public DenariusMainNetParams() { + this.addressHeader = 30; + this.p2shHeader = 90; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.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 c50ae587255..5b59b26fe7e 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -35,6 +35,7 @@ bisq.asset.coins.DarkPay bisq.asset.coins.Dash bisq.asset.coins.Decred bisq.asset.coins.DeepOnion +bisq.asset.coins.Denarius bisq.asset.coins.Dextro bisq.asset.coins.Dogecoin bisq.asset.coins.Doichain diff --git a/assets/src/test/java/bisq/asset/coins/DenariusTest.java b/assets/src/test/java/bisq/asset/coins/DenariusTest.java new file mode 100644 index 00000000000..ad750397bc8 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/DenariusTest.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 DenariusTest extends AbstractAssetTest { + + public DenariusTest() { + super(new Denarius()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("D61tuz8YDdPHdguAzuBW7gWg8ZqCyxcreJ"); + assertValidAddress("DCXErRscjxQ2gEUd21MJ3CUxgtdvnJDJHN"); + assertValidAddress("DHYTH6fvdcaCQ3tEjLLPDpsUjMrKnVbbkF"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("1DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg"); + assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxgs"); + assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg#"); + } +} From 81b032b9bc55770226a3a2ff23ff3255ce512da3 Mon Sep 17 00:00:00 2001 From: carsenk Date: Wed, 20 Nov 2019 18:28:44 -0700 Subject: [PATCH 2/2] List Denarius (D) Signed-off-by: carsenk --- .../main/java/bisq/asset/coins/Denarius.java | 37 ++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/DenariusTest.java | 43 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Denarius.java create mode 100644 assets/src/test/java/bisq/asset/coins/DenariusTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Denarius.java b/assets/src/main/java/bisq/asset/coins/Denarius.java new file mode 100644 index 00000000000..90a70051e2e --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Denarius.java @@ -0,0 +1,37 @@ +/* + * 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 Denarius extends Coin { + + public Denarius() { + super("Denarius", "D", new Base58BitcoinAddressValidator(new DenariusMainNetParams()), Network.MAINNET); + } + + public static class DenariusMainNetParams extends NetworkParametersAdapter { + public DenariusMainNetParams() { + this.addressHeader = 30; + this.p2shHeader = 90; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.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 c50ae587255..5b59b26fe7e 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -35,6 +35,7 @@ bisq.asset.coins.DarkPay bisq.asset.coins.Dash bisq.asset.coins.Decred bisq.asset.coins.DeepOnion +bisq.asset.coins.Denarius bisq.asset.coins.Dextro bisq.asset.coins.Dogecoin bisq.asset.coins.Doichain diff --git a/assets/src/test/java/bisq/asset/coins/DenariusTest.java b/assets/src/test/java/bisq/asset/coins/DenariusTest.java new file mode 100644 index 00000000000..ad750397bc8 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/DenariusTest.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 DenariusTest extends AbstractAssetTest { + + public DenariusTest() { + super(new Denarius()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("D61tuz8YDdPHdguAzuBW7gWg8ZqCyxcreJ"); + assertValidAddress("DCXErRscjxQ2gEUd21MJ3CUxgtdvnJDJHN"); + assertValidAddress("DHYTH6fvdcaCQ3tEjLLPDpsUjMrKnVbbkF"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("1DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg"); + assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxgs"); + assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg#"); + } +}