mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
List Mask (MASK)
This commit is contained in:
parent
d910ca62d1
commit
8aca297edf
4 changed files with 75 additions and 1 deletions
|
@ -60,7 +60,7 @@ public class CryptonoteAddressValidator implements AddressValidator {
|
||||||
return AddressValidationResult.validAddress();
|
return AddressValidationResult.validAddress();
|
||||||
}
|
}
|
||||||
else if (subAddressPrefix.length() == 2 && address.length() == 95 + subAddressPrefix.length()) {
|
else if (subAddressPrefix.length() == 2 && address.length() == 95 + subAddressPrefix.length()) {
|
||||||
// Aeon & Blur-type subaddress
|
// Aeon, Mask & Blur-type subaddress
|
||||||
return AddressValidationResult.validAddress();
|
return AddressValidationResult.validAddress();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
27
assets/src/main/java/bisq/asset/coins/Mask.java
Normal file
27
assets/src/main/java/bisq/asset/coins/Mask.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* 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.Coin;
|
||||||
|
import bisq.asset.CryptonoteAddressValidator;
|
||||||
|
|
||||||
|
public class Mask extends Coin {
|
||||||
|
public Mask() {
|
||||||
|
super("Mask", "MASK", new CryptonoteAddressValidator("M", "bT"));
|
||||||
|
}
|
||||||
|
}
|
|
@ -76,6 +76,7 @@ bisq.asset.coins.Loki
|
||||||
bisq.asset.coins.Madbyte
|
bisq.asset.coins.Madbyte
|
||||||
bisq.asset.coins.Madcoin
|
bisq.asset.coins.Madcoin
|
||||||
bisq.asset.coins.MaidSafeCoin
|
bisq.asset.coins.MaidSafeCoin
|
||||||
|
bisq.asset.coins.Mask
|
||||||
bisq.asset.coins.MaxCoin
|
bisq.asset.coins.MaxCoin
|
||||||
bisq.asset.coins.Mazacoin
|
bisq.asset.coins.Mazacoin
|
||||||
bisq.asset.coins.MegaCoin
|
bisq.asset.coins.MegaCoin
|
||||||
|
|
46
assets/src/test/java/bisq/asset/coins/MaskTest.java
Normal file
46
assets/src/test/java/bisq/asset/coins/MaskTest.java
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* 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 MaskTest extends AbstractAssetTest {
|
||||||
|
|
||||||
|
public MaskTest() {
|
||||||
|
super(new Mask());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testValidAddresses() {
|
||||||
|
assertValidAddress("MbxYjp38aUXBuESwsFv8YmRvbQvMhNyJygU6ViLCjM4sUNqFjsHQim9dvzp9p8BVTjdsRkVNrC1Zy3NJRb18hav3CPe5eWn");
|
||||||
|
assertValidAddress("MeGcanFnSr4bJFuNoHogCBdDCsqDrNu5njPc1Yh1DfsTUTL5dLbbtE119f4vztxXu6fFCKWRmpqjABdDyGrzMDkhTC38WwS");
|
||||||
|
assertValidAddress("bTWEbW8kKVrZkDwyPs5t7BZXotMNyz5UY2QDJ6MjKT7ihA8kNKhoHDqPUiUB7jPxNpXLFkJsgL6TA1fo7yAzVUdm1hTopCocf");
|
||||||
|
assertValidAddress("bTXejHgtfTLWzhyz9fHHBDKTWrsM8MKnebZCKeue8mbDWaKRhnQ8VisGRXUgTvUhsDiwX6PxeP5A22DFf5UVEk431Vjt8m3GM");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInvalidAddresses() {
|
||||||
|
assertInvalidAddress("");
|
||||||
|
assertInvalidAddress("MsopefFnSr4bJFuNoHogCBdDCsqDrNu5Pc1Yh1DfsTUTL5dLbbtE119f4vztxXu6fFCKWRmpqjABdDyGrzMDkhTC38gWw");
|
||||||
|
assertInvalidAddress("MeGcanuyt4bJFuNoHogCBdDCsqDrNu5njPc1Yh1DfsTUTL5dLbbtE119f4vztxXu6fFCKWRmpqujABdDyGrzMDkhTC38WwSx");
|
||||||
|
assertInvalidAddress("MrtcanFnSr4bJFuNoHogCBdDCsqDrNu5Pc1Yh1DfsTUTL5dLbbtE119f4vztxXu6fFCKWRmpqjABdDyGrzMDkhTC3rt4vb8Ww");
|
||||||
|
assertInvalidAddress("bBXejHgtfTLWzhyz9fHKBDKTWrsM8MKnebZCKeue8mbDWaKRhnQ8VisGRXUgTvUhsDiwX6PxeP5A22DFf5UVEk431Vjt8m3GM");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue