Skip to content

Commit

Permalink
NTP: merge with master (#3420)
Browse files Browse the repository at this point in the history
* Temporarily disable onion host for @KanoczTomas's BTC node

* Add Ergo (ERG) without Bouncy Castle dependency.

See #3195.

* List CTSCoin (CTSC)

* Tweak the English name of Japan Bank Transfer payment method

* Add mediator prefix to trade statistics

* List Faircoin (FAIR)

* List uPlexa (UPX)

* Remove not used private methods from BisqEnvironment

* Add onInitP2pNetwork and onInitWallet to BisqSetupListener

- Rename BisqSetupCompleteListener to BisqSetupListener
- Add onInitP2pNetwork and onInitWallet to BisqSetupListener
- make onInitP2pNetwork and onInitWallet default so no impl. required

* Start server at onInitWallet and add wallet password handler

- Add onInitWallet to HttpApiMain and start http server there
- Add onRequestWalletPassword to BisqSetupListener
- Override setupHandlers in HttpApiHeadlessApp and adjust
setRequestWalletPasswordHandler (impl. missing)
- Add onRequestWalletPassword to HttpApiMain

* Add combination (Blockstream.info + Mempool.space) block explorer

* Revert "Temporarily disable onion host for @KanoczTomas's BTC node"

This reverts commit d333520.

* Temporarily disable KanoczTomas btcnode on both onion and clearnet

* Refactor BisqApp - update scene size calculation

* Refactor BisqApp - update error popup message build

* Refactor BisqApp - move icon load into ImageUtil

* Remove unused Utilities

* Increase minimum TX fee to 2 sats/vByte to fix #3106 (#3387)

* Fix mistakes in English source (#3386)

* Fix broken placeholders

* Replace non existing pending trades screen with open trades screen

* Update core/src/main/resources/i18n/displayStrings.properties

Co-Authored-By: Steve Jain <mfiver@gmail.com>

* Update message in failed trade popup

* Refactor BisqEnvironment
  • Loading branch information
ripcurlx authored and sqrrm committed Oct 17, 2019
1 parent 484eb86 commit e26541e
Show file tree
Hide file tree
Showing 24 changed files with 488 additions and 340 deletions.
36 changes: 36 additions & 0 deletions assets/src/main/java/bisq/asset/coins/CTSCoin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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 CTSCoin extends Coin {
public CTSCoin() {
super("CTSCoin", "CTSC", new Base58BitcoinAddressValidator(new CtscMainNetParams()));
}

public static class CtscMainNetParams extends NetworkParametersAdapter {
public CtscMainNetParams() {
this.addressHeader = 66;
this.p2shHeader = 16;
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
}
}
}
53 changes: 53 additions & 0 deletions assets/src/main/java/bisq/asset/coins/Ergo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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.AddressValidationResult;
import bisq.asset.AddressValidator;
import bisq.asset.Coin;

import java.util.Arrays;

import org.bitcoinj.core.Base58;
import org.bitcoinj.core.AddressFormatException;

public class Ergo extends Coin {

public Ergo() {
super("Ergo", "ERG", new ErgoAddressValidator());
}

public static class ErgoAddressValidator implements AddressValidator {

@Override
public AddressValidationResult validate(String address) {
try {
byte[] decoded = Base58.decode(address);
if (decoded.length < 4) {
return AddressValidationResult.invalidAddress("Input too short: " + decoded.length);
}
if (decoded[0] != 1 && decoded[0] != 2 && decoded[0] != 3) {
return AddressValidationResult.invalidAddress("Invalid prefix");
}
} catch (AddressFormatException e) {
return AddressValidationResult.invalidAddress(e);
}
return AddressValidationResult.validAddress();
}
}
}
39 changes: 39 additions & 0 deletions assets/src/main/java/bisq/asset/coins/Faircoin.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 Faircoin extends Coin {

public Faircoin() {
super("Faircoin", "FAIR", new Base58BitcoinAddressValidator(new Faircoin.FaircoinParams()));
}

public static class FaircoinParams extends NetworkParametersAdapter {

public FaircoinParams() {
addressHeader = 95;
p2shHeader = 36;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}

}
30 changes: 30 additions & 0 deletions assets/src/main/java/bisq/asset/coins/uPlexa.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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.AltCoinAccountDisclaimer;
import bisq.asset.Coin;
import bisq.asset.RegexAddressValidator;

@AltCoinAccountDisclaimer("account.altcoin.popup.upx.msg")
public class uPlexa extends Coin {

public uPlexa() {
super("uPlexa", "UPX", new RegexAddressValidator("^((UPX)[1-9A-Za-z^OIl]{95}|(UPi)[1-9A-Za-z^OIl]{106}|(UmV|UmW)[1-9A-Za-z^OIl]{94})$"));
}
}
4 changes: 4 additions & 0 deletions assets/src/main/resources/META-INF/services/bisq.asset.Asset
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bisq.asset.coins.Counterparty
bisq.asset.coins.Credits
bisq.asset.coins.Croat
bisq.asset.coins.CRowdCLassic
bisq.asset.coins.CTSCoin
bisq.asset.coins.DarkPay
bisq.asset.coins.Dash
bisq.asset.coins.Decred
Expand All @@ -40,8 +41,10 @@ bisq.asset.coins.Donu
bisq.asset.coins.Dragonglass
bisq.asset.coins.DSTRA
bisq.asset.coins.Emercoin
bisq.asset.coins.Ergo
bisq.asset.coins.Ether
bisq.asset.coins.EtherClassic
bisq.asset.coins.Faircoin
bisq.asset.coins.FourtyTwo
bisq.asset.coins.Fujicoin
bisq.asset.coins.Galilel
Expand Down Expand Up @@ -99,6 +102,7 @@ bisq.asset.coins.TEO
bisq.asset.coins.TurtleCoin
bisq.asset.coins.UnitedCommunityCoin
bisq.asset.coins.Unobtanium
bisq.asset.coins.uPlexa
bisq.asset.coins.VARIUS
bisq.asset.coins.Veil
bisq.asset.coins.Vertcoin
Expand Down
43 changes: 43 additions & 0 deletions assets/src/test/java/bisq/asset/coins/CTSCoinTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 CTSCoinTest extends AbstractAssetTest {

public CTSCoinTest() {
super(new CTSCoin());
}

@Test
public void testValidAddresses() {
assertValidAddress("Ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT");
assertValidAddress("TwzRDeNSPcJvquuGu7WxxH3RhXBR1VPYHZ");
assertValidAddress("TgYGQJd5TEzDRkyXt1tCvUnrbWBu38C8YK");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT");
assertInvalidAddress("2i6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT");
assertInvalidAddress("Ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnp#");
}
}
47 changes: 47 additions & 0 deletions assets/src/test/java/bisq/asset/coins/ErgoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 ErgoTest extends AbstractAssetTest {

public ErgoTest() {
super(new Ergo());
}

@Test
public void testValidAddresses() {
assertValidAddress("9fRAWhdxEsTcdb8PhGNrZfwqa65zfkuYHAMmkQLcic1gdLSV5vA");
assertValidAddress("25qGdVWg2yyYho8uC1pLtc7KxFn4nEEAwD");
assertValidAddress("23NL9a8ngN28ovtLiKLgHexcdTKBbUMLhH");
assertValidAddress("7bwdkU5V8");
assertValidAddress("BxKBaHkvrTvLZrDcZjcsxsF7aSsrN73ijeFZXtbj4CXZHHcvBtqSxQ");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("9fRAWhdxEsTcdb8PhGNrZfwqa65zfkuYHAMmkQLcic1gdLSV5vAaa");
assertInvalidAddress("25qGdVWg2yyYho8uC1pLtc7KxFn4nEEAwDaa");
assertInvalidAddress("23NL9a8ngN28ovtLiKLgHexcdTKBbUMLhHaa");
assertInvalidAddress("7bwdkU5V8aa");
assertInvalidAddress("BxKBaHkvrTvLZrDcZjcsxsF7aSsrN73ijeFZXtbj4CXZHHcvBtqSxQ#");
}
}
41 changes: 41 additions & 0 deletions assets/src/test/java/bisq/asset/coins/FaircoinTest.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;

public class FaircoinTest extends AbstractAssetTest {

public FaircoinTest() {
super(new Faircoin());
}

@Override
public void testValidAddresses() {
assertValidAddress("fLsJC1Njap5NxSArYr5wCJbKBbTQfWikY6");
assertValidAddress("FZHzHraqjty2Co7TinwcsBtPKoz5ANvgRd");
assertValidAddress("fHbXBBBjU1xxEVmWEtAEwXnoBDxxsxfvxg");
}

@Override
public void testInvalidAddresses() {
assertInvalidAddress("FLsJC1Njap5NxSArYr5wCJbKBbTQfWikY6");
assertInvalidAddress("fZHzHraqjty2Co7TinwcsBtPKoz5ANvgRd");
assertInvalidAddress("1HbXBBBjU1xxEVmWEtAEwXnoBDxxsxfvxg");
}
}
48 changes: 48 additions & 0 deletions assets/src/test/java/bisq/asset/coins/uPlexaTest.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 uPlexaTest extends AbstractAssetTest {

public uPlexaTest() {
super(new uPlexa());
}

@Test
public void testValidAddresses() {
assertValidAddress("UPX1dz81hmfWc7AUhn16JATXJJgZeQZ4zLKA4tnHJHcdS5zoSaKQUoaGqDUQnTXecPL4mjJF1vkwRF3EEq5UJdSw8A84sXDjFP");
assertValidAddress("UPi1S1uqRRNSgC26PjasZP8FwTBRwnAEmBnx5mAYsbGqRvsU46aficYEA3FAT621EuPeChyKQumS7j6jpF74zW9tLJMve8kUJLP5zUgR5ts8W");
assertValidAddress("UmV7QTQs5Q47wMPggtuQSMTvuqNie1MRmbD4AG1xJXykZmxBG4P18p4CHqkV5sKDRXauXWbs76835PZoemQmPGJC1Dv2zdF43");
assertValidAddress("UmWh1MthnAiRP4GuN3DEQxPt6kgeAZfJLUuX1krtufAj2XvUJxDYnuYTAQzEp25V2W8BAJQkfXj8yFNUqQphxddN35nRLnZeE");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("");
assertInvalidAddress("UPXLsinT9duNEtHGqAUicJKD2cmGiB9gB6sqHqWvV6suB4TtPSR8ynyh2vVVvNyDE6g7WEaBxCG8GD1KM2ffWPx7FLXgeJbNYrp");
assertInvalidAddress("UPXsjCoYrxag2pPoDDTB4cRriKCNn8WjhY99kqjYuNdTfE4MU2Yo1CPdpyK7PXpxDcAd5YDNerE6WCc4cVQvEbxLaHk4UcvbRp2");
assertInvalidAddress("UPXsinT9duNEtHGqAUicJKD2cmGiB9gB6sqHqWvV6suBx4TtPSR8ynyh2vVVvNyDE6g7W!!!xCG8GD1KM2ffWP7FLXgeJbNYrp2");
assertInvalidAddress("UmVSrJ7ES1IIIIIGHFm69SU6dTTKt8Vi6V7BoC3wsLccd1Y2CXgQkW7vHSe5uArGU9TjUC5RtvzhCycVDnPPbThTmZA8VqDzTP");
assertInvalidAddress("UmWrJ7ES1wGsikGHFm69SU6dTTKt8Vi6V7BoC3wsLcc1xY2CXgQkW7vHSe5uArGU9TjUC5RtvzhCycVDnPPbThTmZA8VqDzTPe");
assertInvalidAddress("UPi12rJ7ES1wGsikGHFm69SU6dTTKt8Vi6V7BoC36sqHqWvwsLcc1Y2CXgQkW7vHSe5uArGU9TjUC5RtvzhCycVDnPPbThTmZA8VqDzTPeM1");
assertInvalidAddress("UPisBB18NdcSywKDshsywbjc5uCi8ybSUtWgvM3LfzaYe93vd6DEu3PcSywKDshsywbjc5uCi8ybSUtWgvM3LfzaYe93d96NjjvBCYU2SZD2of");
}
}
Loading

0 comments on commit e26541e

Please sign in to comment.