Skip to content

Commit

Permalink
List LitecoinZ (LTZ)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLTZ committed Feb 7, 2019
1 parent edabca6 commit be257da
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
31 changes: 31 additions & 0 deletions assets/src/main/java/bisq/asset/coins/LitecoinZ.java
@@ -0,0 +1,31 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AltCoinAccountDisclaimer;
import bisq.asset.Coin;
import bisq.asset.RegexAddressValidator;

@AltCoinAccountDisclaimer("account.altcoin.popup.LTZ.msg")
public class LitecoinZ extends Coin {

public LitecoinZ() {
super("LitecoinZ", "LTZ", new RegexAddressValidator("^L.*", "validation.altcoin.ltz.zAddressesNotSupported"));
}

}
3 changes: 2 additions & 1 deletion assets/src/main/resources/META-INF/services/bisq.asset.Asset
Expand Up @@ -42,6 +42,7 @@ bisq.asset.coins.IdaPay
bisq.asset.coins.Iridium
bisq.asset.coins.Kekcoin
bisq.asset.coins.Litecoin
bisq.asset.coins.LitecoinZ
bisq.asset.coins.Lytix
bisq.asset.coins.Mask
bisq.asset.coins.Mile
Expand Down Expand Up @@ -79,4 +80,4 @@ bisq.asset.coins.Zero
bisq.asset.coins.ZeroOneCoin
bisq.asset.tokens.AugmintEuro
bisq.asset.tokens.EtherStone
bisq.asset.tokens.VectorspaceAI
bisq.asset.tokens.VectorspaceAI
43 changes: 43 additions & 0 deletions assets/src/test/java/bisq/asset/coins/LitecoinZTest.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 <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class LitecoinZTest extends AbstractAssetTest {

public LitecoinZTest() {
super(new LitecoinZ());
}

@Test
public void testValidAddresses() {
assertValidAddress("L17opZaVcRK4h9MV4KhkCmzUBa56BxSRb8A");
assertValidAddress("L1EjNbAPVtg8jE9EyvbsA7epibZ9j8bdYmV");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem");
assertInvalidAddress("38NwrYsD1HxQW5zfLT0QcUUXGMPvQgzTSn");
assertInvalidAddress("8tP9rh3SH6n9cSLmV22vnSNNw56LKGpLrB");
assertInvalidAddress("8Zbvjr");
}
}
1 change: 1 addition & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -2574,6 +2574,7 @@ validation.nationalAccountId={0} must consist of {1} numbers.
validation.invalidInput=Invalid input: {0}
validation.accountNrFormat=Account number must be of format: {0}
validation.altcoin.wrongStructure=Address validation failed because it does not match the structure of a {0} address.
validation.altcoin.ltz.zAddressesNotSupported=LTZ address need to start with L. Addresses starting with z are not supported.
validation.altcoin.zAddressesNotSupported=ZEC address need to start with t. Addresses starting with z are not supported.
validation.altcoin.invalidAddress=Address is not a valid {0} address! {1}
validation.bic.invalidLength=Input length is neither 8 nor 11
Expand Down

0 comments on commit be257da

Please sign in to comment.