mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Merge branch 'master' of https://github.com/bisq-network/bisq into rpm-package
# Conflicts: # desktop/package/linux/package.sh # desktop/package/linux/rpm.sh
This commit is contained in:
commit
ed7a7df2ad
@ -1,7 +1,7 @@
|
||||
language: java
|
||||
jdk: openjdk10
|
||||
before_install:
|
||||
grep -v '^#' src/main/resources/META-INF/services/bisq.asset.Asset | sort --check --dictionary-order --ignore-case
|
||||
grep -v '^#' assets/src/main/resources/META-INF/services/bisq.asset.Asset | sort --check --dictionary-order --ignore-case
|
||||
notifications:
|
||||
slack:
|
||||
on_success: change
|
||||
|
@ -0,0 +1,25 @@
|
||||
package bisq.asset;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* When a new PaymentAccount is created for given asset, this annotation tells UI to show user a disclaimer message
|
||||
* with requirements needed to be fulfilled when conducting trade given payment method.
|
||||
*
|
||||
* I.e. in case of Monero user must use official Monero GUI wallet or Monero CLI wallet with certain options enabled,
|
||||
* user needs to keep tx private key, tx hash, recipient's address, etc.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface AltCoinAccountDisclaimer {
|
||||
|
||||
/**
|
||||
* Translation key of the message to show, i.e. "account.altcoin.popup.xmr.msg"
|
||||
* @return translation key
|
||||
*/
|
||||
String value();
|
||||
|
||||
}
|
@ -26,15 +26,22 @@ package bisq.asset;
|
||||
public class RegexAddressValidator implements AddressValidator {
|
||||
|
||||
private final String regex;
|
||||
private final String errorMessageI18nKey;
|
||||
|
||||
public RegexAddressValidator(String regex) {
|
||||
this(regex, null);
|
||||
}
|
||||
|
||||
public RegexAddressValidator(String regex, String errorMessageI18nKey) {
|
||||
this.regex = regex;
|
||||
this.errorMessageI18nKey = errorMessageI18nKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches(regex))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
if (errorMessageI18nKey == null) return AddressValidationResult.invalidStructure();
|
||||
else return AddressValidationResult.invalidAddress("", errorMessageI18nKey);
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
|
36
assets/src/main/java/bisq/asset/coins/Australiacash.java
Normal file
36
assets/src/main/java/bisq/asset/coins/Australiacash.java
Normal file
@ -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 Australiacash extends Coin {
|
||||
public Australiacash() {
|
||||
super("Australiacash", "AUS", new Base58BitcoinAddressValidator(new AustraliacashParams()));
|
||||
}
|
||||
public static class AustraliacashParams extends NetworkParametersAdapter {
|
||||
|
||||
public AustraliacashParams() {
|
||||
addressHeader = 23;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -17,9 +17,11 @@
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.CryptonoteAddressValidator;
|
||||
|
||||
@AltCoinAccountDisclaimer("account.altcoin.popup.blur.msg")
|
||||
public class Blur extends Coin {
|
||||
|
||||
public Blur() {
|
||||
|
56
assets/src/main/java/bisq/asset/coins/DeepOnion.java
Normal file
56
assets/src/main/java/bisq/asset/coins/DeepOnion.java
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
import org.libdohj.params.DashMainNetParams;
|
||||
|
||||
public class DeepOnion extends Coin {
|
||||
public DeepOnion() {
|
||||
super("DeepOnion", "ONION", new DeepOnionAddressValidator());
|
||||
}
|
||||
|
||||
public static class DeepOnionAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public DeepOnionAddressValidator() {
|
||||
super(new DeepOnionParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[D][a-km-zA-HJ-NP-Z1-9]{24,33}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
public static class DeepOnionParams extends NetworkParametersAdapter {
|
||||
|
||||
public DeepOnionParams() {
|
||||
super();
|
||||
addressHeader = 31;
|
||||
p2shHeader = 78;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -17,10 +17,11 @@
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
// Not an ICO token (see https://github.com/bisq-network/proposals/issues/57#issuecomment-441671418)
|
||||
@AltCoinAccountDisclaimer("account.altcoin.popup.drgl.msg")
|
||||
public class Dragonglass extends Coin {
|
||||
|
||||
public Dragonglass() {
|
||||
|
@ -17,9 +17,11 @@
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.CryptonoteAddressValidator;
|
||||
|
||||
@AltCoinAccountDisclaimer("account.altcoin.popup.xmr.msg")
|
||||
public class Monero extends Coin {
|
||||
|
||||
public Monero() {
|
||||
|
28
assets/src/main/java/bisq/asset/coins/Persona.java
Normal file
28
assets/src/main/java/bisq/asset/coins/Persona.java
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Persona extends Coin {
|
||||
|
||||
public Persona() {
|
||||
super("Persona", "PRSN", new RegexAddressValidator("^[P][a-km-zA-HJ-NP-Z1-9]{33}$"));
|
||||
}
|
||||
}
|
@ -17,26 +17,15 @@
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
@AltCoinAccountDisclaimer("account.altcoin.popup.ZEC.msg")
|
||||
public class Zcash extends Coin {
|
||||
|
||||
public Zcash() {
|
||||
super("Zcash", "ZEC", new ZcashAddressValidator());
|
||||
super("Zcash", "ZEC", new RegexAddressValidator("^t.*", "validation.altcoin.zAddressesNotSupported"));
|
||||
}
|
||||
|
||||
|
||||
public static class ZcashAddressValidator implements AddressValidator {
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
// We only support t addresses (transparent transactions)
|
||||
if (!address.startsWith("t"))
|
||||
return AddressValidationResult.invalidAddress("", "validation.altcoin.zAddressesNotSupported");
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,9 +17,11 @@
|
||||
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
@AltCoinAccountDisclaimer("account.altcoin.popup.XZC.msg")
|
||||
public class Zcoin extends Coin {
|
||||
|
||||
public Zcoin() {
|
||||
|
@ -4,10 +4,11 @@
|
||||
# See https://bisq.network/list-asset for complete instructions.
|
||||
bisq.asset.coins.Actinium
|
||||
bisq.asset.coins.Aeon
|
||||
bisq.asset.coins.Australiacash
|
||||
bisq.asset.coins.Beam
|
||||
bisq.asset.coins.BitcoinRhodium
|
||||
bisq.asset.coins.Bitcoin$Mainnet
|
||||
bisq.asset.coins.Bitcoin$Regtest
|
||||
bisq.asset.coins.BitcoinRhodium
|
||||
bisq.asset.coins.Bitcoin$Testnet
|
||||
bisq.asset.coins.Bitmark
|
||||
bisq.asset.coins.Blur
|
||||
@ -20,15 +21,16 @@ bisq.asset.coins.Counterparty
|
||||
bisq.asset.coins.Croat
|
||||
bisq.asset.coins.Dash
|
||||
bisq.asset.coins.Decred
|
||||
bisq.asset.coins.DeepOnion
|
||||
bisq.asset.coins.Dextro
|
||||
bisq.asset.coins.Dogecoin
|
||||
bisq.asset.coins.Dragonglass
|
||||
bisq.asset.coins.Ether
|
||||
bisq.asset.coins.EtherClassic
|
||||
bisq.asset.coins.GambleCoin
|
||||
bisq.asset.coins.Grin
|
||||
bisq.asset.coins.FourtyTwo
|
||||
bisq.asset.coins.GambleCoin
|
||||
bisq.asset.coins.Gridcoin
|
||||
bisq.asset.coins.Grin
|
||||
bisq.asset.coins.Horizen
|
||||
bisq.asset.coins.IdaPay
|
||||
bisq.asset.coins.Iridium
|
||||
@ -42,6 +44,7 @@ bisq.asset.coins.MoX
|
||||
bisq.asset.coins.Namecoin
|
||||
bisq.asset.coins.Neos
|
||||
bisq.asset.coins.Noir
|
||||
bisq.asset.coins.Persona
|
||||
bisq.asset.coins.Pinkcoin
|
||||
bisq.asset.coins.PIVX
|
||||
bisq.asset.coins.PZDC
|
||||
|
43
assets/src/test/java/bisq/asset/coins/AustraliacashTest.java
Normal file
43
assets/src/test/java/bisq/asset/coins/AustraliacashTest.java
Normal file
@ -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 AustraliacashTest extends AbstractAssetTest {
|
||||
|
||||
public AustraliacashTest() {
|
||||
super(new Australiacash());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("AYf2TGCoQ15HatyE99R3q9jVcXHLx1zRWW");
|
||||
assertValidAddress("Aahw1A79we2jUbTaamP5YALh21GSxiWTZa");
|
||||
assertValidAddress("ALp3R9W3QsCdqaNNcULySXN31dYvfvDkRU");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("1ALp3R9W3QsCdqaNNcULySXN31dYvfvDkRU");
|
||||
assertInvalidAddress("ALp3R9W3QsCdrqaNNcULySXN31dYvfvDkRU");
|
||||
assertInvalidAddress("ALp3R9W3QsCdqaNNcULySXN31dYvfvDkRU#");
|
||||
}
|
||||
}
|
44
assets/src/test/java/bisq/asset/coins/DeepOnionTest.java
Normal file
44
assets/src/test/java/bisq/asset/coins/DeepOnionTest.java
Normal file
@ -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 DeepOnionTest extends AbstractAssetTest {
|
||||
|
||||
public DeepOnionTest() {
|
||||
super(new DeepOnion());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("DYQLyJ1CcxJyRBujtKdv2JDkQEkEkAzNNA");
|
||||
assertValidAddress("DW7YKfPgm7fdTNGyyaSVfQhY7ccBoeVK5D");
|
||||
assertValidAddress("DsA31xPpijxiCuTQeYMpMTQsTH1m2jTgtS");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("1sA31xPpijxiCuTQeYMpMTQsTH1m2jTgtS");
|
||||
assertInvalidAddress("DsA31xPpijxiCuTQeYMpMTQsTH1m2jTgtSd");
|
||||
assertInvalidAddress("DsA31xPpijxiCuTQeYMpMTQsTH1m2jTgt#");
|
||||
}
|
||||
}
|
49
assets/src/test/java/bisq/asset/coins/PersonaTest.java
Normal file
49
assets/src/test/java/bisq/asset/coins/PersonaTest.java
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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 PersonaTest extends AbstractAssetTest {
|
||||
|
||||
public PersonaTest() {
|
||||
super(new Persona());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("PV5PbsyhkM1RkN41QiSXy7cisbZ4kBzm51");
|
||||
assertValidAddress("PJACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("");
|
||||
assertInvalidAddress("LJACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
assertInvalidAddress("TJACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
assertInvalidAddress("PJACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zAA");
|
||||
assertInvalidAddress("PlACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
assertInvalidAddress("PIACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
assertInvalidAddress("POACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
assertInvalidAddress("P0ACMZ2tMMZzQ8H9mWPHJcB7uYP47BM2zA");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ configure(project(':desktop')) {
|
||||
apply plugin: 'witness'
|
||||
apply from: '../gradle/witness/gradle-witness.gradle'
|
||||
|
||||
version = '0.9.2-SNAPSHOT'
|
||||
version = '0.9.3-SNAPSHOT'
|
||||
|
||||
mainClassName = 'bisq.desktop.app.BisqAppMain'
|
||||
|
||||
@ -318,6 +318,13 @@ configure(project(':desktop')) {
|
||||
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
|
||||
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
||||
}
|
||||
|
||||
test {
|
||||
systemProperty 'jdk.attach.allowAttachSelf', true
|
||||
|
||||
def jmockit = configurations.testCompile.files.find { it.name.contains("jmockit") }.absolutePath
|
||||
jvmArgs "-javaagent:$jmockit"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class Version {
|
||||
// VERSION = 0.5.0 introduces proto buffer for the P2P network and local DB and is a not backward compatible update
|
||||
// Therefore all sub versions start again with 1
|
||||
// We use semantic versioning with major, minor and patch
|
||||
public static final String VERSION = "0.9.2";
|
||||
public static final String VERSION = "0.9.3";
|
||||
|
||||
public static int getMajorVersion(String version) {
|
||||
return getSubVersion(version, 0);
|
||||
|
@ -482,6 +482,12 @@ public class CurrencyUtil {
|
||||
throw new IllegalArgumentException("We are on mainnet and we could not find an asset with network type mainnet");
|
||||
}
|
||||
|
||||
public static Optional<Asset> findAsset(String tickerSymbol) {
|
||||
return assetRegistry.stream()
|
||||
.filter(asset -> asset.getTickerSymbol().equals(tickerSymbol))
|
||||
.findAny();
|
||||
}
|
||||
|
||||
public static Optional<Asset> findAsset(String tickerSymbol, BaseCurrencyNetwork baseCurrencyNetwork) {
|
||||
return assetRegistry.stream()
|
||||
.filter(asset -> asset.getTickerSymbol().equals(tickerSymbol))
|
||||
|
@ -263,6 +263,10 @@ public final class TradeStatistics2 implements LazyProcessedPayload, Persistable
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return tradeAmount > 0 && tradePrice > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TradeStatistics2{" +
|
||||
|
@ -103,7 +103,9 @@ public class TradeStatisticsManager {
|
||||
Map<String, TradeStatistics2> map = new HashMap<>();
|
||||
p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().values().stream()
|
||||
.filter(e -> e instanceof TradeStatistics2)
|
||||
.forEach(e -> addToMap((TradeStatistics2) e, map));
|
||||
.map(e -> (TradeStatistics2) e)
|
||||
.filter(TradeStatistics2::isValid)
|
||||
.forEach(e -> addToMap(e, map));
|
||||
observableTradeStatisticsSet.addAll(map.values());
|
||||
|
||||
priceFeedService.applyLatestBisqMarketPrice(observableTradeStatisticsSet);
|
||||
@ -149,16 +151,18 @@ public class TradeStatisticsManager {
|
||||
|
||||
private void addToMap(TradeStatistics2 tradeStatistics, boolean storeLocally) {
|
||||
if (!observableTradeStatisticsSet.contains(tradeStatistics)) {
|
||||
boolean itemAlreadyAdded = observableTradeStatisticsSet.stream()
|
||||
.anyMatch(e -> (e.getOfferId().equals(tradeStatistics.getOfferId())));
|
||||
if (!itemAlreadyAdded) {
|
||||
observableTradeStatisticsSet.add(tradeStatistics);
|
||||
if (storeLocally) {
|
||||
priceFeedService.applyLatestBisqMarketPrice(observableTradeStatisticsSet);
|
||||
dump();
|
||||
}
|
||||
} else {
|
||||
log.debug("We have already an item with the same offer ID. That might happen if both the maker and the taker published the tradeStatistics");
|
||||
|
||||
if (observableTradeStatisticsSet.stream()
|
||||
.anyMatch(e -> (e.getOfferId().equals(tradeStatistics.getOfferId()))))
|
||||
return;
|
||||
|
||||
if (!tradeStatistics.isValid())
|
||||
return;
|
||||
|
||||
observableTradeStatisticsSet.add(tradeStatistics);
|
||||
if (storeLocally) {
|
||||
priceFeedService.applyLatestBisqMarketPrice(observableTradeStatisticsSet);
|
||||
dump();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1038,15 +1038,6 @@ transfer using the Blur Transaction Viewer (https://blur.cash/#tx-viewer).\n\n\
|
||||
Failure to provide the required information to the arbitrator will result in losing the dispute case. In all cases of dispute, the \
|
||||
BLUR sender bears 100% of the burden of responsibility in verifying transactions to an arbitrator. \n\n\
|
||||
If you do not understand these requirements, do not trade on Bisq. First, seek help at the Blur Network Discord (https://discord.gg/dMWaqVW).
|
||||
account.altcoin.popup.ccx.msg=Trading CCX on Bisq requires that you understand the following requirements:\n\n\
|
||||
To send CCX you must use an official Conceal wallet, either CLI or GUI. After sending a transfer payment, the wallets\n\
|
||||
display the transaction secret key. You must save it along with the transaction hash (ID) and the recipient's public\n\
|
||||
address in case arbitration is necessary. In such a case, you must give all three to the arbitrator, who will then\n\
|
||||
verify the CCX transfer using the Conceal Transaction Viewer (https://explorer.conceal.network/txviewer).\n\
|
||||
Because Conceal is a privacy coin, block explorers cannot verify transfers.\n\n\
|
||||
Failure to provide the required data to the arbitrator will result in losing the dispute case.\n\
|
||||
If you do not save the transaction secret key immediately after transferring CCX, it cannot be recovered later.\n\
|
||||
If you do not understand these requirements, seek help at the Conceal discord (http://discord.conceal.network).
|
||||
account.altcoin.popup.drgl.msg=Trading Dragonglass on Bisq requires that you understand and fulfill \
|
||||
the following requirements:\n\n\
|
||||
Because of the privacy Dragonglass provides, a transaction is not verifiable on the public blockchain. If required, you \
|
||||
@ -1064,17 +1055,10 @@ Failure to provide the above data, or if you used an incompatible wallet, will r
|
||||
dispute case. The Dragonglass sender is responsible for providing verification of the DRGL transfer to the \
|
||||
arbitrator in case of a dispute. Use of PaymentID is not required.\n\n\
|
||||
If you are unsure about any part of this process, visit Dragonglass on Discord (http://discord.drgl.info) for help.
|
||||
account.altcoin.popup.ZEC.msg=When using {0} you can only use the transparent addresses (starting with t) not \
|
||||
account.altcoin.popup.ZEC.msg=When using Zcash you can only use the transparent addresses (starting with t) not \
|
||||
the z-addresses (private), because the arbitrator would not be able to verify the transaction with z-addresses.
|
||||
account.altcoin.popup.XZC.msg=When using {0} you can only use the transparent (traceable) addresses not \
|
||||
account.altcoin.popup.XZC.msg=When using Zcoin you can only use the transparent (traceable) addresses not \
|
||||
the untraceable addresses, because the arbitrator would not be able to verify the transaction with untraceable addresses at a block explorer.
|
||||
account.altcoin.popup.bch=Bitcoin Cash and Bitcoin Clashic suffer from replay protection. If you use those coins be sure you take sufficient precautions and understand all implications.\
|
||||
You can suffer losses by sending one coin and unintentionally send the same coins on the other block chain.\
|
||||
Because those "airdrop coins" share the same history with the Bitcoin blockchain there are also security risks and a considerable risk for losing privacy.\n\n\
|
||||
Please read at the Bisq Forum more about that topic: https://forum.bisq.io/t/airdrop-coins-information-thread-bch-btg-bchc
|
||||
account.altcoin.popup.btg=Because Bitcoin Gold shares the same history as the Bitcoin blockchain it comes with certain security risks and a considerable risk for losing privacy.\
|
||||
If you use Bitcoin Gold be sure you take sufficient precautions and understand all implications.\n\n\
|
||||
Please read at the Bisq Forum more about that topic: https://forum.bisq.io/t/airdrop-coins-information-thread-bch-btg-bchc
|
||||
|
||||
account.fiat.yourFiatAccounts=Your national currency accounts
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# pull base image
|
||||
FROM openjdk:8-jdk
|
||||
ENV version 0.9.2
|
||||
ENV version 0.9.3-SNAPSHOT
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/* &&
|
||||
apt-get install -y vim fakeroot
|
||||
|
@ -6,7 +6,7 @@
|
||||
# - Update version below
|
||||
# - Ensure JAVA_HOME below is pointing to OracleJDK 10 directory
|
||||
|
||||
version=0.9.2-SNAPSHOT
|
||||
version=0.9.3-SNAPSHOT
|
||||
version_base=$(echo $version | awk -F'[_-]' '{print $1}')
|
||||
base_dir=$( cd "$(dirname "$0")" ; pwd -P )/../../..
|
||||
src_dir=$base_dir/desktop/package
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Prior to running this script:
|
||||
# - Update version below
|
||||
|
||||
version=0.9.2-SNAPSHOT
|
||||
version=0.9.3-SNAPSHOT
|
||||
base_dir=$( cd "$(dirname "$0")" ; pwd -P )/../../..
|
||||
package_dir=$base_dir/desktop/package
|
||||
release_dir=$base_dir/desktop/release/$version
|
||||
|
@ -5,10 +5,10 @@
|
||||
<!-- See: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -->
|
||||
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.9.2</string>
|
||||
<string>0.9.3</string>
|
||||
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.9.2</string>
|
||||
<string>0.9.3</string>
|
||||
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Bisq</string>
|
||||
|
@ -6,7 +6,7 @@ mkdir -p deploy
|
||||
|
||||
set -e
|
||||
|
||||
version="0.9.2-SNAPSHOT"
|
||||
version="0.9.3-SNAPSHOT"
|
||||
|
||||
cd ..
|
||||
./gradlew :desktop:build -x test shadowJar
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
cd ../../
|
||||
|
||||
version="0.9.2-SNAPSHOT"
|
||||
version="0.9.3-SNAPSHOT"
|
||||
|
||||
target_dir="releases/$version"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
@echo off
|
||||
|
||||
set version=0.9.2-SNAPSHOT
|
||||
set version=0.9.3-SNAPSHOT
|
||||
set package_dir=%~dp0..
|
||||
for /F "tokens=1,2,3 delims=.-" %%a in ("%version%") do (
|
||||
set file_version=%%a.%%b.%%c
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
@echo off
|
||||
|
||||
set version=0.9.2-SNAPSHOT
|
||||
set version=0.9.3-SNAPSHOT
|
||||
set release_dir=%~dp0..\..\..\releases\%version%
|
||||
set package_dir=%~dp0..
|
||||
|
||||
|
@ -29,6 +29,7 @@ import bisq.desktop.util.Layout;
|
||||
import bisq.core.dao.governance.asset.AssetService;
|
||||
import bisq.core.filter.FilterManager;
|
||||
import bisq.core.locale.CryptoCurrency;
|
||||
import bisq.core.locale.CurrencyUtil;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.locale.TradeCurrency;
|
||||
import bisq.core.payment.AccountAgeWitnessService;
|
||||
@ -39,6 +40,9 @@ import bisq.core.payment.validation.AltCoinAddressValidator;
|
||||
import bisq.core.util.BSFormatter;
|
||||
import bisq.core.util.validation.InputValidator;
|
||||
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Asset;
|
||||
|
||||
import bisq.common.util.Tuple2;
|
||||
import bisq.common.util.Tuple3;
|
||||
|
||||
@ -54,6 +58,8 @@ import javafx.scene.layout.VBox;
|
||||
|
||||
import javafx.collections.ObservableList;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static bisq.desktop.util.FormBuilder.add2ButtonsAfterGroup;
|
||||
import static bisq.desktop.util.FormBuilder.add3ButtonsAfterGroup;
|
||||
import static bisq.desktop.util.FormBuilder.addTitledGroupBg;
|
||||
@ -115,7 +121,6 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
|
||||
private void onSaveNewAccount(PaymentAccount paymentAccount) {
|
||||
TradeCurrency selectedTradeCurrency = paymentAccount.getSelectedTradeCurrency();
|
||||
if (selectedTradeCurrency != null) {
|
||||
String code = selectedTradeCurrency.getCode();
|
||||
if (selectedTradeCurrency instanceof CryptoCurrency && ((CryptoCurrency) selectedTradeCurrency).isAsset()) {
|
||||
String name = selectedTradeCurrency.getName();
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.wallet.msg",
|
||||
@ -126,47 +131,14 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
|
||||
.show();
|
||||
}
|
||||
|
||||
switch (code) {
|
||||
case "XMR":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.xmr.msg"))
|
||||
final Optional<Asset> asset = CurrencyUtil.findAsset(selectedTradeCurrency.getCode());
|
||||
if (asset.isPresent()) {
|
||||
final AltCoinAccountDisclaimer disclaimerAnnotation = asset.get().getClass().getAnnotation(AltCoinAccountDisclaimer.class);
|
||||
if (disclaimerAnnotation != null) {
|
||||
new Popup<>().information(Res.get(disclaimerAnnotation.value()))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "BLUR":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.blur.msg"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "CCX":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.ccx.msg"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "DRGL":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.drgl.msg"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "ZEC":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.ZEC.msg", "ZEC"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "XZC":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.XZC.msg", "XZC"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "BCHC":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.bch"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
case "BTG":
|
||||
new Popup<>().information(Res.get("account.altcoin.popup.btg"))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (model.getPaymentAccounts().stream().noneMatch(e -> e.getAccountName() != null &&
|
||||
|
@ -336,6 +336,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||
private void updateChartData() {
|
||||
seriesBuy.getData().clear();
|
||||
seriesSell.getData().clear();
|
||||
areaChart.getData().clear();
|
||||
|
||||
final Optional<XYChart.Data> buyMinOptional = model.getBuyData().stream()
|
||||
.min(Comparator.comparingDouble(o -> (double) o.getXValue()))
|
||||
@ -369,6 +370,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||
seriesBuy.getData().addAll(model.getBuyData());
|
||||
//noinspection unchecked
|
||||
seriesSell.getData().addAll(model.getSellData());
|
||||
areaChart.getData().addAll(seriesBuy, seriesSell);
|
||||
}
|
||||
|
||||
private Tuple4<TableView<OfferListItem>, VBox, Button, Label> getOfferTable(OfferPayload.Direction direction) {
|
||||
|
@ -60,13 +60,10 @@ import mockit.MockUp;
|
||||
import mockit.Tested;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
//TODO @Christoph Can you have a look why JMockit is nto working anymore in that module?
|
||||
@Ignore
|
||||
public class TradesChartsViewModelTest {
|
||||
@Tested
|
||||
TradesChartsViewModel model;
|
||||
|
@ -405,7 +405,6 @@ public class OfferBookViewModelTest {
|
||||
assertEquals(10, model.maxPlacesForMarketPriceMargin.intValue()); //" (-10.00%)"
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetPrice() {
|
||||
OfferBook offerBook = mock(OfferBook.class);
|
||||
@ -435,10 +434,10 @@ public class OfferBookViewModelTest {
|
||||
model.activate();
|
||||
|
||||
assertEquals("12557.2046 (1.00%)", model.getPrice(lowItem));
|
||||
assertEquals(" 10.0000 ", model.getPrice(fixedItem));
|
||||
assertEquals("10.0000", model.getPrice(fixedItem));
|
||||
offerBookListItems.addAll(item);
|
||||
assertEquals("14206.1304 (-12.00%)", model.getPrice(item));
|
||||
assertEquals("12557.2046 (1.00%)", model.getPrice(lowItem));
|
||||
assertEquals("12557.2046 (1.00%)", model.getPrice(lowItem));
|
||||
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@ -180,7 +179,6 @@ public class BSFormatterTest {
|
||||
assertEquals("0.1000 - 0.2000", formatter.formatAmount(offer, 4, true, 15));
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testFormatAmountWithAlignmenWithDecimalsNoRange() {
|
||||
OfferPayload offerPayload = mock(OfferPayload.class);
|
||||
@ -188,7 +186,7 @@ public class BSFormatterTest {
|
||||
when(offerPayload.getMinAmount()).thenReturn(10000000L);
|
||||
when(offerPayload.getAmount()).thenReturn(10000000L);
|
||||
|
||||
assertEquals(" 0.1000", formatter.formatAmount(offer, 4, true, 15));
|
||||
assertEquals("0.1000", formatter.formatAmount(offer, 4, true, 15));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1 +1 @@
|
||||
0.9.2
|
||||
0.9.3-SNAPSHOT
|
||||
|
@ -33,7 +33,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class SeedNodeMain extends ExecutableForAppWithP2p {
|
||||
private static final String VERSION = "0.9.2";
|
||||
private static final String VERSION = "0.9.3";
|
||||
private SeedNode seedNode;
|
||||
|
||||
public SeedNodeMain() {
|
||||
|
Loading…
Reference in New Issue
Block a user