Merge pull request #2876 from apaulb/list-myce-asset

List Myce (YCE)
This commit is contained in:
Christoph Atteneder 2019-07-12 18:56:53 +02:00 committed by GitHub
commit 9d2740eb32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,37 @@
/*
* 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.Base58BitcoinAddressValidator;
import bisq.asset.Coin;
import bisq.asset.NetworkParametersAdapter;
public class Myce extends Coin {
public Myce() {
super("Myce", "YCE", new Base58BitcoinAddressValidator(new MyceParams()));
}
public static class MyceParams extends NetworkParametersAdapter {
public MyceParams() {
addressHeader = 50;
p2shHeader = 85;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}
}

View file

@ -64,6 +64,7 @@ bisq.asset.coins.MobitGlobal
bisq.asset.coins.Monero
bisq.asset.coins.MonetaryUnit
bisq.asset.coins.MoX
bisq.asset.coins.Myce
bisq.asset.coins.Namecoin
bisq.asset.coins.Navcoin
bisq.asset.coins.Neos

View 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 org.junit.Test;
import bisq.asset.AbstractAssetTest;
public class MyceTest extends AbstractAssetTest {
public MyceTest() {
super(new Myce());
}
@Test
public void testValidAddresses() {
assertValidAddress("MCgtattGUWUBAV8n2JAa4uDWCRvbZeVcaD");
assertValidAddress("MRV2dtuxwo8b1JSkwBXN3uGypJxp85Hbqn");
assertValidAddress("MEUvfCySnAqzuNvbRh2SZCbSro8e2dxLYK");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("MCgtattGUWUBAV8n2JAa4uDWCRvbZeVcaDx");
assertInvalidAddress("AUV2dtuxwo8b1JSkwBXN3uGypJxp85Hbqn");
assertInvalidAddress("SEUvfCySnAqzuNvbRh2SZCbSro8e2dxLYK");
}
}