mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 14:42:37 +01:00
Merge pull request #3324 from ctscoin/list-ctsc-asset
List CTSCoin (CTSC)
This commit is contained in:
commit
bae6e7ab33
3 changed files with 80 additions and 0 deletions
36
assets/src/main/java/bisq/asset/coins/CTSCoin.java
Normal file
36
assets/src/main/java/bisq/asset/coins/CTSCoin.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 CTSCoin extends Coin {
|
||||
public CTSCoin() {
|
||||
super("CTSCoin", "CTSC", new Base58BitcoinAddressValidator(new CtscMainNetParams()));
|
||||
}
|
||||
|
||||
public static class CtscMainNetParams extends NetworkParametersAdapter {
|
||||
public CtscMainNetParams() {
|
||||
this.addressHeader = 66;
|
||||
this.p2shHeader = 16;
|
||||
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ bisq.asset.coins.Counterparty
|
|||
bisq.asset.coins.Credits
|
||||
bisq.asset.coins.Croat
|
||||
bisq.asset.coins.CRowdCLassic
|
||||
bisq.asset.coins.CTSCoin
|
||||
bisq.asset.coins.DarkPay
|
||||
bisq.asset.coins.Dash
|
||||
bisq.asset.coins.Decred
|
||||
|
|
43
assets/src/test/java/bisq/asset/coins/CTSCoinTest.java
Normal file
43
assets/src/test/java/bisq/asset/coins/CTSCoinTest.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 CTSCoinTest extends AbstractAssetTest {
|
||||
|
||||
public CTSCoinTest() {
|
||||
super(new CTSCoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("Ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT");
|
||||
assertValidAddress("TwzRDeNSPcJvquuGu7WxxH3RhXBR1VPYHZ");
|
||||
assertValidAddress("TgYGQJd5TEzDRkyXt1tCvUnrbWBu38C8YK");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT");
|
||||
assertInvalidAddress("2i6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT");
|
||||
assertInvalidAddress("Ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnp#");
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue