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

Commit

Permalink
List Bitcoin Instant (BTI)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitcoin Instant committed Jun 26, 2018
1 parent ef62dc3 commit eb0a450
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/main/java/bisq/asset/coins/BitcoinInstant.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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 BitcoinInstant extends Coin {

public BitcoinInstant() {
super("Bitcoin Instant", "BTI", new Base58BitcoinAddressValidator(new BitcoinInstantParams()));
}

public static class BitcoinInstantParams extends NetworkParametersAdapter {

public BitcoinInstantParams() {
addressHeader = 0x66;
p2shHeader = 0x05;
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 @@ -10,6 +10,7 @@ bisq.asset.coins.BitcoinCash
bisq.asset.coins.BitcoinClashic
bisq.asset.coins.BitcoinCore
bisq.asset.coins.BitcoinGold
bisq.asset.coins.BitcoinInstant
bisq.asset.coins.Bitcoin$Mainnet
bisq.asset.coins.Bitcoin$Regtest
bisq.asset.coins.Bitcoin$Testnet
Expand Down
48 changes: 48 additions & 0 deletions src/test/java/bisq/asset/coins/BitcoinInstantTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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 BitcoinInstantTest extends AbstractAssetTest {

public BitcoinInstantTest() {
super(new BitcoinInstant());
}

@Test
public void testValidAddresses() {
assertValidAddress("iG4DCE2RKHH47FcguJsfKXKuF4sdQ519Tt");
assertValidAddress("i83W3SJH4KVfb94kprXRVXaoLYajFsNeGx");
assertValidAddress("iDpT25zn3um3kpQCE3ZuMK6gmHviixgFvQ");
assertValidAddress("iNdhv889Gqp67qdgsTc8K9zBfmqXvGLrtc");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJXX");
assertInvalidAddress("12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJ");
assertInvalidAddress("12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJ#");
assertInvalidAddress("12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX");
assertInvalidAddress("iG4DCE2RKHH47FcguJsfKXKuF4sdQ519Ttt");
assertInvalidAddress("iG4DCE2RKHH47FcguJsfKXKuF4sdQ519T");
assertInvalidAddress("iG4DCE2RKHH47FcguJsfKXKuF4sdQ519T#");
}
}

0 comments on commit eb0a450

Please sign in to comment.