Skip to content

Commit

Permalink
List Chaucha (CHA)
Browse files Browse the repository at this point in the history
  • Loading branch information
egyware committed Oct 3, 2018
1 parent 6873d03 commit 27cfac6
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
39 changes: 39 additions & 0 deletions assets/src/main/java/bisq/asset/coins/Chaucha.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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 Chaucha extends Coin {

public Chaucha() {
super("Chaucha", "CHA", new Base58BitcoinAddressValidator(new ChauchaParams()));
}

public static class ChauchaParams extends NetworkParametersAdapter {

public ChauchaParams() {
addressHeader = 88;
p2shHeader = 50;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ bisq.asset.coins.Burstcoin
bisq.asset.coins.Byteball
bisq.asset.coins.Cagecoin
bisq.asset.coins.CassubianDetk
bisq.asset.coins.Chaucha
bisq.asset.coins.Conceal
bisq.asset.coins.Counterparty
bisq.asset.coins.Creativecoin
Expand Down
43 changes: 43 additions & 0 deletions assets/src/test/java/bisq/asset/coins/ChauchaTest.java
Original file line number Diff line number Diff line change
@@ -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 ChauchaTest extends AbstractAssetTest {

public ChauchaTest() {
super(new Chaucha());
}

@Test
public void testValidAddresses() {
assertValidAddress("cTC7AodMWM4fXsG1TDu4JLn2qKQoMg4F9N");
assertValidAddress("caWnffHrx8wkQqcSVJ7wpRvN1E7Ztz7kPP");
assertValidAddress("ciWwaG4trw1vQZSL4F4phQqznK4NgZURdQ");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("1cTC7AodMWM4fXsG1TDu4JLn2qKQoMg4F9N");
assertInvalidAddress("cTC7AodMWM4fXsG1TDu4JLn2qKQoMg4F9XN");
assertInvalidAddress("cTC7AodMWM4fXsG1TDu4JLn2qKQoMg4F9N#");
}
}

0 comments on commit 27cfac6

Please sign in to comment.