Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

List Madbyte (MBYT) #47

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/main/java/bisq/asset/coins/Madbyte.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.RegexAddressValidator;

public class Madbyte extends Coin {

public Madbyte() {
super("Madbyte", "MBYT", new RegexAddressValidator("^[M][a-zA-Z0-9]{33}$"));
}
}
1 change: 1 addition & 0 deletions src/main/java/bisq/core/locale/CurrencyUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public static List<CryptoCurrency> getMainCryptoCurrencies() {
result.add(new CryptoCurrency("GRC", "Gridcoin"));
if (!baseCurrencyCode.equals("LTC"))
result.add(new CryptoCurrency("LTC", "Litecoin"));
result.add(new CryptoCurrency("MBYT", "Madbyte"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not touch this file.

result.add(new CryptoCurrency("XMR", "Monero"));
result.add(new CryptoCurrency("MT", "Mycelium Token", true));
result.add(new CryptoCurrency("NMC", "Namecoin"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ private void printAllCurrencyStats() {
newlyAdded.add("GEO");
newlyAdded.add("GRANS");
newlyAdded.add("ICH");
newlyAdded.add("MBYT");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not touch this file.



coinsWithValidator.addAll(newlyAdded);

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/services/bisq.asset.Asset
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ bisq.asset.coins.Lisk
bisq.asset.coins.Litecoin$Mainnet
bisq.asset.coins.Litecoin$Regtest
bisq.asset.coins.Litecoin$Testnet
bisq.asset.coins.Madbyte
bisq.asset.coins.Madcoin
bisq.asset.coins.MaidSafeCoin
bisq.asset.coins.Monero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,21 @@ public void testPHR() {
assertFalse(validator.validate("").isValid);
}

@Test
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbeams do we want anybody to touch this file anymore?

public void testMBYT() {
validator.setCurrencyCode("MBYT");

assertTrue(validator.validate("MEvQJ25RDsENWhPHkApDZPXjrFxKUR9mGR").isValid);
assertTrue(validator.validate("MMqP3zkuZvHiupEe5DHXjr2NNwhc9EhB2J").isValid);
assertTrue(validator.validate("MBegzGWVKWxFk8Eq5NP6veEQAaEnfj3udf").isValid);

assertFalse(validator.validate("mEvQJ25RDsENWhPHkApDZPXjrFxKUR9mGR").isValid);
assertFalse(validator.validate("MMqP3zkuZvHiupEe5DHXjr2NNwhc9EhB2Js").isValid);
assertFalse(validator.validate("MMqP3zkuZvHiupEe5DHXjr2NNwhc9EhB2").isValid);
assertFalse(validator.validate("MBegzGWVKWxFk8Eq5NP6veEQAaEnfj3ud#").isValid);
assertFalse(validator.validate("").isValid);
}

private void testDefaultValidator(String currencyCode) {
validator.setCurrencyCode(currencyCode);

Expand Down