mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
List Zero (ZER)
This commit is contained in:
parent
f562ffa424
commit
2dfb2e3b8f
3 changed files with 86 additions and 0 deletions
42
assets/src/main/java/bisq/asset/coins/Zero.java
Normal file
42
assets/src/main/java/bisq/asset/coins/Zero.java
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* 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.AddressValidationResult;
|
||||||
|
import bisq.asset.AddressValidator;
|
||||||
|
import bisq.asset.Coin;
|
||||||
|
|
||||||
|
public class Zero extends Coin {
|
||||||
|
|
||||||
|
public Zero() {
|
||||||
|
super("Zero", "ZER", new ZeroAddressValidator());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class ZeroAddressValidator implements AddressValidator {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AddressValidationResult validate(String address) {
|
||||||
|
// We only support t addresses (transparent transactions)
|
||||||
|
if (!address.startsWith("t1"))
|
||||||
|
return AddressValidationResult.invalidAddress("", "validation.altcoin.zAddressesNotSupported");
|
||||||
|
|
||||||
|
return AddressValidationResult.validAddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -122,6 +122,7 @@ bisq.asset.coins.Yenten
|
||||||
bisq.asset.coins.Zcash
|
bisq.asset.coins.Zcash
|
||||||
bisq.asset.coins.Zcoin
|
bisq.asset.coins.Zcoin
|
||||||
bisq.asset.coins.ZenCash
|
bisq.asset.coins.ZenCash
|
||||||
|
bisq.asset.coins.Zero
|
||||||
bisq.asset.coins.ZeroOneCoin
|
bisq.asset.coins.ZeroOneCoin
|
||||||
bisq.asset.tokens.BetterBetting
|
bisq.asset.tokens.BetterBetting
|
||||||
bisq.asset.tokens.DaiStablecoin
|
bisq.asset.tokens.DaiStablecoin
|
||||||
|
|
43
assets/src/test/java/bisq/asset/coins/ZeroTest.java
Normal file
43
assets/src/test/java/bisq/asset/coins/ZeroTest.java
Normal file
|
@ -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 ZeroTest extends AbstractAssetTest {
|
||||||
|
|
||||||
|
public ZeroTest() {
|
||||||
|
super(new Zero());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testValidAddresses() {
|
||||||
|
assertValidAddress("t1cZTNaKS6juH6tGEhCUZmZhtbYGeYeuTrK");
|
||||||
|
assertValidAddress("t1ZBPYJwK2UPbshwcYWRiCq7vw8VPDYumWu");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInvalidAddresses() {
|
||||||
|
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem");
|
||||||
|
assertInvalidAddress("38NwrYsD1HxQW5zfLT0QcUUXGMPvQgzTSn");
|
||||||
|
assertInvalidAddress("8tP9rh3SH6n9cSLmV22vnSNNw56LKGpLrB");
|
||||||
|
assertInvalidAddress("8Zbvjr");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue