Merge pull request #2128 from geo-gs/list-siaprimecoin

List SiaPrimeCoin (SCP)
This commit is contained in:
Christoph Atteneder 2018-12-20 09:23:59 +01:00 committed by GitHub
commit 4f0fd9eafb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 0 deletions

View file

@ -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 SiaPrimeCoin extends Coin {
public SiaPrimeCoin() {
super("SiaPrimeCoin", "SCP", new RegexAddressValidator("^([0-9a-z]{76})$"));
}
}

View file

@ -43,6 +43,7 @@ bisq.asset.coins.Radium
bisq.asset.coins.Remix
bisq.asset.coins.Ryo
bisq.asset.coins.Siafund
bisq.asset.coins.SiaPrimeCoin
bisq.asset.coins.Spectrecoin
bisq.asset.coins.Starwels
bisq.asset.coins.SUB1X

View file

@ -0,0 +1,45 @@
/*
* 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 SiaPrimeCoinTest extends AbstractAssetTest {
public SiaPrimeCoinTest() {
super(new SiaPrimeCoin());
}
@Test
public void testValidAddresses() {
assertValidAddress("d9fe1331ed2ae1bbdfe0e2942e84d74b7310648e5a5f14c4980ec2c6a19f08af6894b9060e83");
assertValidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca2031");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("");
assertInvalidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca20311");
assertInvalidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca203");
assertInvalidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca2031#");
assertInvalidAddress("bvQpKvb1SswwxVTuyZocHWCVsUeGq7MwoR");
assertInvalidAddress("d9fe1331ed2ae1bbdfe0e2942e84d74b7310648e5a5f14c4980ec2c6a19f08af6894b9060E83");
}
}