From dc89c2a832f2e25ec9761d7435d749a9375aeb3d Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 10 Oct 2018 15:30:05 +0800 Subject: [PATCH 1/2] List SpaceCash (SPACE) --- .../main/java/bisq/asset/coins/SpaceCash.java | 28 ++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/SpaceCashTest.java | 44 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/SpaceCash.java create mode 100644 assets/src/test/java/bisq/asset/coins/SpaceCashTest.java diff --git a/assets/src/main/java/bisq/asset/coins/SpaceCash.java b/assets/src/main/java/bisq/asset/coins/SpaceCash.java new file mode 100644 index 00000000000..cf636ba9919 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/SpaceCash.java @@ -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 . + */ + +package bisq.asset.coins; + +import bisq.asset.Coin; +import bisq.asset.RegexAddressValidator; + +public class SpaceCash extends Coin { + + public SpaceCash() { + super("SpaceCash", "SPACE", new RegexAddressValidator("^([0-9a-z]{76})$")); + } +} \ No newline at end of file diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index 1054568aebd..56a8b95a673 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -114,6 +114,7 @@ bisq.asset.coins.Semux bisq.asset.coins.Siacoin bisq.asset.coins.Siafund bisq.asset.coins.Sibcoin +bisq.asset.coins.SpaceCash bisq.asset.coins.Spectrecoin bisq.asset.coins.SpeedCash bisq.asset.coins.Starwels diff --git a/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java b/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java new file mode 100644 index 00000000000..e4b10d13187 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java @@ -0,0 +1,44 @@ +/* + * 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 . + */ + +package bisq.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class SpaceCashTest extends AbstractAssetTest { + + public SpaceCashTest() { + super(new SpaceCash()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("d9fe1331ed2ae1bbdfe0e2942e84d74b7310648e5a5f14c4980ec2c6a19f08af6894b9060e83"); + assertValidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca2031"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca20311"); + assertInvalidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca203"); + assertInvalidAddress("205cf3be0f04397ee6cc1f52d8ae47f589a4ef5936949c158b2555df291efb87db2bbbca2031#"); + assertInvalidAddress("bvQpKvb1SswwxVTuyZocHWCVsUeGq7MwoR"); + assertInvalidAddress("d9fe1331ed2ae1bbdfe0e2942e84d74b7310648e5a5f14c4980ec2c6a19f08af6894b9060E83"); + } +} \ No newline at end of file From 30ceb9d14149ca12f620123031aaac4f509124f1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 16 Oct 2018 12:18:32 +0800 Subject: [PATCH 2/2] add newlines at the end of files --- assets/src/main/java/bisq/asset/coins/SpaceCash.java | 2 +- assets/src/test/java/bisq/asset/coins/SpaceCashTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/src/main/java/bisq/asset/coins/SpaceCash.java b/assets/src/main/java/bisq/asset/coins/SpaceCash.java index cf636ba9919..46e8064477f 100644 --- a/assets/src/main/java/bisq/asset/coins/SpaceCash.java +++ b/assets/src/main/java/bisq/asset/coins/SpaceCash.java @@ -25,4 +25,4 @@ public class SpaceCash extends Coin { public SpaceCash() { super("SpaceCash", "SPACE", new RegexAddressValidator("^([0-9a-z]{76})$")); } -} \ No newline at end of file +} diff --git a/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java b/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java index e4b10d13187..942662c58fb 100644 --- a/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java +++ b/assets/src/test/java/bisq/asset/coins/SpaceCashTest.java @@ -41,4 +41,4 @@ public void testInvalidAddresses() { assertInvalidAddress("bvQpKvb1SswwxVTuyZocHWCVsUeGq7MwoR"); assertInvalidAddress("d9fe1331ed2ae1bbdfe0e2942e84d74b7310648e5a5f14c4980ec2c6a19f08af6894b9060E83"); } -} \ No newline at end of file +}