Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
freimair committed Aug 14, 2019
2 parents 4ed65c2 + 4eb8840 commit c80ab94
Show file tree
Hide file tree
Showing 39 changed files with 111 additions and 364 deletions.
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -17,4 +17,12 @@ Follow the step-by-step instructions at https://bisq.network/get-started.

## Contribute to Bisq

See [CONTRIBUTING.md](CONTRIBUTING.md) and the [developer docs](docs#readme).
Bisq currently requires JDK 10 . See the scripts directory for scripts that can be used to install and configure the JDK automatically.

TIP: If you are on MacOS, run the script with this command . scripts/install_java.sh.

If you prefer not to run scripts or change your default java, you can use Adoptopenjdk https://adoptopenjdk.net/archive.html. Just untar it where you like, and set java home when running gradle. for example: `JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.2+13/Contents/Home ./gradlew clean build



See [CONTRIBUTING.md](CONTRIBUTING.md) and the [developer docs](docs/README.md).
39 changes: 4 additions & 35 deletions build.gradle
@@ -1,7 +1,3 @@
if (JavaVersion.current() != JavaVersion.VERSION_1_10) {
// feel free to delete this if you know what you are doing
throw new GradleException("This build must be run with java 10. See docs/build.md")
}
buildscript {
repositories {
jcenter()
Expand Down Expand Up @@ -49,7 +45,6 @@ configure(subprojects) {
jcsvVersion = '1.4.0'
jetbrainsAnnotationsVersion = '13.0'
jfoenixVersion = '9.0.6'
jmockitVersion = '1.42'
joptVersion = '5.0.3'
jsonsimpleVersion = '1.1.1'
junitVersion = '4.12'
Expand All @@ -58,9 +53,8 @@ configure(subprojects) {
langVersion = '3.4'
logbackVersion = '1.1.10'
lombokVersion = '1.18.2'
mockitoVersion = '2.21.0'
mockitoVersion = '3.0.0'
netlayerVersion = '0.6.5.1'
powermockVersion = '2.0.0-beta.5'
protobufVersion = '3.5.1'
pushyVersion = '0.13.2'
qrgenVersion = '1.3'
Expand Down Expand Up @@ -112,17 +106,6 @@ configure([project(':desktop'),
// copy generated shell scripts, e.g. `bisq-desktop` directly to the project
// root directory for discoverability and ease of use

// TODO @cbeams The copy task below fails because the copied files are conflicting with the project
// folder name. I temporarily delete those files as I think they are duplicated anyway (bisq-* are probably
// the one to use). Would be good if those files don't get created in the first place.
// The .bat files are also deleted.
delete fileTree(dir: "$destinationDir/bin", include: 'desktop*')
delete fileTree(dir: "$destinationDir/bin", include: 'monitor*')
delete fileTree(dir: "$destinationDir/bin", include: 'seednode*')
delete fileTree(dir: "$destinationDir/bin", include: 'pricenode*')
delete fileTree(dir: "$destinationDir/bin", include: 'statsnode*')
delete fileTree(dir: "$destinationDir/bin", include: 'relay*')

copy {
from "$destinationDir/bin"
into rootProject.projectDir
Expand Down Expand Up @@ -236,9 +219,10 @@ configure(project(':p2p')) {
compile "org.fxmisc.easybind:easybind:$easybindVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testCompile 'org.jmockit:jmockit:1.30' // must not use current $jmockitVersion
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion")

}
}

Expand Down Expand Up @@ -273,12 +257,7 @@ configure(project(':core')) {
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"

testCompile "org.jmockit:jmockit:$jmockitVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude(module: 'objenesis')
}
testCompile "org.powermock:powermock-module-junit4:$powermockVersion"
testCompile "org.powermock:powermock-api-mockito2:$powermockVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion")
testCompile "org.springframework:spring-test:$springVersion"
testCompile "com.natpryce:make-it-easy:$easyVersion"
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: "$hamcrestVersion"
Expand All @@ -288,9 +267,6 @@ configure(project(':core')) {

test {
systemProperty 'jdk.attach.allowAttachSelf', true

def jmockit = configurations.testCompile.files.find { it.name.contains("jmockit") }.absolutePath
jvmArgs "-javaagent:$jmockit"
}
}

Expand Down Expand Up @@ -331,12 +307,8 @@ configure(project(':desktop')) {
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"

testCompile "org.jmockit:jmockit:$jmockitVersion"
testCompile("org.mockito:mockito-core:$mockitoVersion") {
exclude(module: 'objenesis')
}
testCompile "org.powermock:powermock-module-junit4:$powermockVersion"
testCompile "org.powermock:powermock-api-mockito2:$powermockVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "com.natpryce:make-it-easy:$easyVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
Expand All @@ -345,9 +317,6 @@ configure(project(':desktop')) {

test {
systemProperty 'jdk.attach.allowAttachSelf', true

def jmockit = configurations.testCompile.files.find { it.name.contains("jmockit") }.absolutePath
jvmArgs "-javaagent:$jmockit"
}
}

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/bisq/core/btc/nodes/BtcNodes.java
Expand Up @@ -77,6 +77,9 @@ public List<BtcNode> getProvidedBtcNodes() {
// sgeisler
new BtcNode("bcwat.ch", "z33nukt7ngik3cpe.onion", "5.189.166.193", BtcNode.DEFAULT_PORT, "@sgeisler"),

// wiz
new BtcNode("node100.hnl.wiz.biz", "22tg6ufbwz6o3l2u.onion", "103.99.168.100", BtcNode.DEFAULT_PORT, "@wiz"),

// others
new BtcNode("btc.jochen-hoenicke.de", "sslnjjhnmwllysv4.onion", "88.198.39.205", BtcNode.DEFAULT_PORT, "@jhoenicke"),
new BtcNode("bitcoin4-fullnode.csg.uzh.ch", null, "192.41.136.217", BtcNode.DEFAULT_PORT, "@tbocek") // requested onion
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/i18n/displayStrings_es.properties
Expand Up @@ -1872,7 +1872,7 @@ showWalletDataWindow.includePrivKeys=Incluir claves privadas:

# We do not translate the tac because of the legal nature. We would need translations checked by lawyers
# in each language which is too expensive atm.
tacWindow.headline=Acuerdo de usario
tacWindow.headline=Acuerdo de usuario
tacWindow.agree=Estoy de acuerdo
tacWindow.disagree=No estoy de acuerdo, salir
tacWindow.arbitrationSystem=Sistema arbitraje
Expand Down
Expand Up @@ -21,19 +21,9 @@

import bisq.network.p2p.NodeAddress;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

import java.security.Security;

import java.util.ArrayList;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
Expand All @@ -42,9 +32,6 @@
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;

@RunWith(PowerMockRunner.class)
@PrepareForTest({User.class, ArbitratorService.class})
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class ArbitratorManagerTest {


Expand Down
Expand Up @@ -24,9 +24,6 @@

import java.util.List;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;

import org.junit.Ignore;
import org.junit.Test;

Expand All @@ -36,8 +33,6 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@PrepareForTest(BtcWalletService.class)
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class TxFeeEstimationServiceTest {

@Test
Expand Down
Expand Up @@ -22,12 +22,7 @@

import java.util.List;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Test;
import org.junit.runner.RunWith;

import static bisq.core.btc.nodes.BtcNodes.BitcoinNodesOption.CUSTOM;
import static bisq.core.btc.nodes.BtcNodes.BitcoinNodesOption.PUBLIC;
Expand All @@ -36,9 +31,6 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest(Preferences.class)
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class BtcNodesSetupPreferencesTest {
@Test
public void testSelectPreferredNodesWhenPublicOption() {
Expand Down
Expand Up @@ -11,20 +11,14 @@
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest({PeriodService.class, ProposalPayload.class, ProposalValidatorProvider.class})
public class BallotListServiceTest {
@Test
@SuppressWarnings("unchecked")
Expand Down
47 changes: 7 additions & 40 deletions core/src/test/java/bisq/core/dao/node/full/BlockParserTest.java
Expand Up @@ -17,44 +17,10 @@

package bisq.core.dao.node.full;

import bisq.core.dao.node.parser.BlockParser;
import bisq.core.dao.node.parser.TxParser;
import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.model.blockchain.TxInput;
import bisq.core.dao.state.model.blockchain.TxOutputKey;

import bisq.common.proto.persistable.PersistenceProtoResolver;

import org.bitcoinj.core.Coin;

import com.neemre.btcdcli4j.core.domain.RawBlock;
import com.neemre.btcdcli4j.core.domain.RawTransaction;

import com.google.common.collect.ImmutableList;

import java.io.File;

import java.math.BigDecimal;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;

import mockit.Expectations;
import mockit.Injectable;
import mockit.Tested;

import org.junit.Ignore;
import org.junit.Test;

import static java.util.Arrays.asList;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;


// not converting this test because it is already ignored.
// Intro to jmockit can be found at http://jmockit.github.io/tutorial/Mocking.html
@Ignore
//@Ignore
/*
public class BlockParserTest {
// @Tested classes are instantiated automatically when needed in a test case,
// using injection where possible, see http://jmockit.github.io/tutorial/Mocking.html#tested
Expand Down Expand Up @@ -213,7 +179,7 @@ public void testParseBlocks() {
});
*/

// Verify that the genesis tx has been added to the bsq blockchain with the correct issuance amount
// Verify that the genesis tx has been added to the bsq blockchain with the correct issuance amount
/* assertTrue(daoStateService.getGenesisTx().get() == genesisTx);
assertTrue(daoStateService.getGenesisTotalSupply().getValue() == issuance.getValue());
Expand All @@ -232,7 +198,8 @@ public void testParseBlocks() {
assertTrue(bsqOut2.getValue() == bsqTx1Value2);
assertFalse(daoStateService.isTxOutputSpendable(genesisTxId, 0));
assertTrue(daoStateService.isTxOutputSpendable(bsqTx1Id, 0));
assertTrue(daoStateService.isTxOutputSpendable(bsqTx1Id, 1));*/
assertTrue(daoStateService.isTxOutputSpendable(bsqTx1Id, 1));
}
}
}
*/
Expand Up @@ -20,22 +20,14 @@
import bisq.core.dao.governance.period.CycleService;
import bisq.core.dao.monitoring.DaoStateMonitoringService;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.mockito.Mockito.mock;

@RunWith(PowerMockRunner.class)
@PrepareForTest({DaoStateService.class, GenesisTxInfo.class, CycleService.class, DaoStateStorageService.class, DaoStateMonitoringService.class})
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class DaoStateSnapshotServiceTest {

private DaoStateSnapshotService daoStateSnapshotService;
Expand Down
8 changes: 0 additions & 8 deletions core/src/test/java/bisq/core/offer/OfferTest.java
Expand Up @@ -17,21 +17,13 @@

package bisq.core.offer;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest(OfferPayload.class)
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class OfferTest {

@Test
Expand Down
8 changes: 0 additions & 8 deletions core/src/test/java/bisq/core/offer/OpenOfferManagerTest.java
Expand Up @@ -9,22 +9,14 @@

import java.util.concurrent.atomic.AtomicBoolean;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Test;
import org.junit.runner.RunWith;

import static bisq.core.offer.OfferMaker.btcUsdOffer;
import static com.natpryce.makeiteasy.MakeItEasy.make;
import static junit.framework.TestCase.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;

@RunWith(PowerMockRunner.class)
@PrepareForTest({P2PService.class, PeerManager.class, OfferBookService.class, Storage.class})
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class OpenOfferManagerTest {

@Test
Expand Down
8 changes: 0 additions & 8 deletions core/src/test/java/bisq/core/payment/PaymentAccountsTest.java
Expand Up @@ -28,12 +28,7 @@
import java.util.Set;
import java.util.function.BiFunction;

import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
Expand All @@ -42,9 +37,6 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest({PaymentAccount.class, AccountAgeWitness.class})
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class PaymentAccountsTest {
@Test
public void testGetOldestPaymentAccountForOfferWhenNoValidAccounts() {
Expand Down

0 comments on commit c80ab94

Please sign in to comment.