Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #52 from motioncrypto/motionlisting
Browse files Browse the repository at this point in the history
List Motion (XMN)
  • Loading branch information
cbeams committed Jun 29, 2018
2 parents d7af198 + a3b16fc commit 25be5b4
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/main/java/bisq/asset/coins/Motion.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 Motion extends Coin {

public Motion() {
super("Motion", "XMN", new Base58BitcoinAddressValidator(new MotionParams()));
}


public static class MotionParams extends NetworkParametersAdapter {

public MotionParams() {
addressHeader = 50;
p2shHeader = 18;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/META-INF/services/bisq.asset.Asset
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ bisq.asset.coins.MegaCoin
bisq.asset.coins.MFCoin
bisq.asset.coins.MicroCoin
bisq.asset.coins.Monero
bisq.asset.coins.Motion
bisq.asset.coins.Namecoin
bisq.asset.coins.Nano
bisq.asset.coins.NavCoin
Expand Down
44 changes: 44 additions & 0 deletions src/test/java/bisq/asset/coins/MotionTest.java
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class MotionTest extends AbstractAssetTest {

public MotionTest() {
super(new Motion());
}

@Test
public void testValidAddresses() {
assertValidAddress("MUQXDHrau4NbDJ93GcTP3q2JEb9dUpUz9n");
assertValidAddress("MCi4PALzN9U2TL7UAQXJTEorJgYYKwzv7j");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("MidkVmR8GaT3oQthbm6jVxG5R7LnLVAvKwX");
assertInvalidAddress("MidkVmR8GaT3oQthbm6jVxG5R7LnLVAvK");
assertInvalidAddress("MidkVmR8GaT3oQthbm6jVxG5R7LnLVAvK#");
assertInvalidAddress("XidkVmR8GaT3oQthbm6jVxG5R7LnLVAvKwX");
assertInvalidAddress("yidkVmR8GaT3oQthbm6jVxG5R7LnLVAvKwX");
}
}

0 comments on commit 25be5b4

Please sign in to comment.