From 00788ff491365cdabbe1b4bde07c0f4a61c07c38 Mon Sep 17 00:00:00 2001 From: Maik Broemme Date: Thu, 12 Dec 2019 00:44:46 +0100 Subject: [PATCH] List Limitless VIP (VIP) --- .../java/bisq/asset/coins/LimitlessVIP.java | 36 ++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../bisq/asset/coins/LimitlessVIPTest.java | 43 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/LimitlessVIP.java create mode 100644 assets/src/test/java/bisq/asset/coins/LimitlessVIPTest.java diff --git a/assets/src/main/java/bisq/asset/coins/LimitlessVIP.java b/assets/src/main/java/bisq/asset/coins/LimitlessVIP.java new file mode 100644 index 00000000000..8b9608a21e5 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/LimitlessVIP.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 LimitlessVIP extends Coin { + public LimitlessVIP() { + super("Limitless VIP", "VIP", new Base58BitcoinAddressValidator(new LimitlessVIPMainNetParams())); + } + + public static class LimitlessVIPMainNetParams extends NetworkParametersAdapter { + public LimitlessVIPMainNetParams() { + this.addressHeader = 65; + this.p2shHeader = 127; + 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..a5f72edf49b 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -62,6 +62,7 @@ bisq.asset.coins.KnowYourDeveloper bisq.asset.coins.Kore bisq.asset.coins.Krypton bisq.asset.coins.LBRYCredits +bisq.asset.coins.LimitlessVIP bisq.asset.coins.Litecoin bisq.asset.coins.LitecoinPlus bisq.asset.coins.LitecoinZ diff --git a/assets/src/test/java/bisq/asset/coins/LimitlessVIPTest.java b/assets/src/test/java/bisq/asset/coins/LimitlessVIPTest.java new file mode 100644 index 00000000000..04becfbc0c2 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/LimitlessVIPTest.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 LimitlessVIPTest extends AbstractAssetTest { + + public LimitlessVIPTest() { + super(new LimitlessVIP()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("TPfCkKQPK1FURXoAbvgEZUGK7pabqjwqPS"); + assertValidAddress("TQppRgMV3heoqpV3qVnercsvk4vKvQqutf"); + assertValidAddress("TPZDAaACPtKkBAEf2EsKJLMPiDML2APWoM"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("1TM993FEHjreKmfmeVfrU7XNP8gJqRX5uhb"); + assertInvalidAddress("TM993FEHjreKmfmeVfrU7XNP8gJqRX5uhbd"); + assertInvalidAddress("TM993FEHjreKmfmeVfrU7XNP8gJqRX5uhb#"); + } +}