Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Bitmark (BTM) #2078

Merged
merged 1 commit into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions assets/src/main/java/bisq/asset/coins/Bitmark.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.Base58BitcoinAddressValidator;
import bisq.asset.NetworkParametersAdapter;

public class Bitmark extends Coin {

public static class BitmarkParams extends NetworkParametersAdapter {
public BitmarkParams() {
addressHeader = 85;
p2shHeader = 5;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}

public Bitmark() {
super("Bitmark", "BTM", new Base58BitcoinAddressValidator(new BitmarkParams()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bisq.asset.coins.BitcoinRhodium
bisq.asset.coins.Bitcoin$Mainnet
bisq.asset.coins.Bitcoin$Regtest
bisq.asset.coins.Bitcoin$Testnet
bisq.asset.coins.Bitmark
bisq.asset.coins.Blur
bisq.asset.coins.BSQ$Mainnet
bisq.asset.coins.BSQ$Regtest
Expand Down
41 changes: 41 additions & 0 deletions assets/src/test/java/bisq/asset/coins/BitmarkTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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 BitmarkTest extends AbstractAssetTest {

public BitmarkTest() {
super(new Bitmark());
}

@Test
public void testValidAddresses() {
assertValidAddress("bMigVohTEiA3gxhFWpDJBrZ14j2RnDkWCs");
assertValidAddress("bKMivcHXMNfs3P3AaTtyhDiZ7s8Nw3ek6L");
assertValidAddress("bXUYGzbV8v6pLZtkYDL3feyrRFFnc37e3H");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("bMigVohTEiA3gxhFWpDJBrZ14j2RnDkWCt");
assertInvalidAddress("F9z7PKmo1sLQYtFuZjTQ1zZXhPQtHLScKT");
assertInvalidAddress("16Ftsh4Ff2ijPNsnQAUf5fKTp7DJaGxSZK");
}
}