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

Fulfilling Proposal #110 #3275

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
da3b693
This is to initiate the update necessary for the fulfillment of proposal
niyid Sep 16, 2019
c879121
Merging messages from proposal #110 messages with HEAD.
niyid Sep 16, 2019
3383f71
Cleaning up.
niyid Sep 16, 2019
39f89b5
Cleaning up.
niyid Sep 16, 2019
7a2e54f
Cleaning up formatting.
niyid Sep 16, 2019
1ac19a2
Cleaning up formatting.
niyid Sep 16, 2019
4100fe4
Quick fix; misplaced bracket.
niyid Sep 16, 2019
f06f171
Switching mode to debug from info.
niyid Sep 16, 2019
35643bc
Keeping abreast of new changes.
niyid Sep 17, 2019
6bd447f
Merge branch 'master' of https://github.com/bisq-network/bisq
niyid Sep 17, 2019
471960c
Refixing merged items.
niyid Sep 17, 2019
2825e23
Upgraded to monero-wallet-java v0.1.1
niyid Sep 17, 2019
3c7f1d2
Maven plugin resolved the problem with monero-wallet-rpc.
niyid Sep 17, 2019
4545b01
Temporary fix; adding monero-wallet-rpc library source as part of core.
niyid Sep 17, 2019
ce2e327
Removed references to view component in core component.
niyid Sep 17, 2019
66dfb26
RPC digest authentication fixed.
niyid Sep 18, 2019
fa393a7
Digest not needed.
niyid Sep 18, 2019
c117b3f
Replacing monero-java with a stripped down version of less than 10
niyid Sep 20, 2019
3f50cce
Replacing monero-java references in the view.
niyid Sep 20, 2019
1235780
Replacement of monero-java with compact version complete.
niyid Sep 20, 2019
63cff66
Test ignore for now.
niyid Sep 20, 2019
4596d29
Display destination address; filter out transactions older than 90 days.
niyid Sep 20, 2019
b8e84ae
References to Log4J and JUnit in non test-case classes removed.
niyid Sep 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion build.gradle
Expand Up @@ -69,7 +69,6 @@ configure(subprojects) {
reactfxVersion = '2.0-M3'
sarxosVersion = '0.3.12'
slf4jVersion = '1.7.22'
log4jVersion = '1.2.17'
sparkVersion = '2.5.2'
springBootVersion = '1.5.10.RELEASE'
springVersion = '4.3.6.RELEASE'
Expand Down Expand Up @@ -157,6 +156,8 @@ configure(project(':assets')) {
compile "com.google.guava:guava:$guavaVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.apache.commons:commons-lang3:$langVersion"
compile "junit:junit:$junitVersion"
compile "log4j:log4j:1.2.17"
}
}

Expand All @@ -174,6 +175,8 @@ configure(project(':common')) {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
compile "junit:junit:$junitVersion"
compile "log4j:log4j:1.2.17"
compile "org.openjfx:javafx-base:11:$os"
compile "org.openjfx:javafx-graphics:11:$os"
compile "com.google.protobuf:protobuf-java:$protobufVersion"
Expand Down
67 changes: 6 additions & 61 deletions core/src/main/java/bisq/core/xmr/wallet/XmrWalletRpcWrapper.java
Expand Up @@ -27,12 +27,10 @@
import bisq.common.app.DevEnv;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.xmr.wallet.listeners.WalletBalanceListener;
import bisq.core.xmr.wallet.listeners.WalletUiListener;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
import lombok.extern.slf4j.Slf4j;
import monero.rpc.MoneroRpcConnection;
import monero.wallet.MoneroWalletRpc;
Expand Down Expand Up @@ -84,7 +82,7 @@ public XmrWalletRpcWrapper(Preferences preferences) {
}
}

public void update(WalletBalanceListener listener, HashMap<String, Object> walletRpcData) {
public void update(WalletUiListener listener, HashMap<String, Object> walletRpcData) {
Runnable command = new Runnable() {

@Override
Expand Down Expand Up @@ -149,7 +147,7 @@ public boolean test(MoneroTxWallet t) {
return list.size() > 100 ? list.subList(0, 100) : list;//Reduce transactions to no more than 100.
}

public void searchTx(WalletBalanceListener listener, String commaSeparatedIds) {
public void searchTx(WalletUiListener listener, String commaSeparatedIds) {
Runnable command = new Runnable() {

@Override
Expand Down Expand Up @@ -177,7 +175,7 @@ public void run() {
}
}

public void createTx(WalletBalanceListener listener, Integer accountIndex, String address,
public void createTx(WalletUiListener listener, Integer accountIndex, String address,
BigInteger amount, MoneroSendPriority priority, boolean doNotRelay, HashMap<String, Object> walletRpcData) {
Runnable command = new Runnable() {

Expand Down Expand Up @@ -226,7 +224,7 @@ public void run() {
}
}

public void relayTx(WalletBalanceListener listener, HashMap<String, Object> walletRpcData) {
public void relayTx(WalletUiListener listener, HashMap<String, Object> walletRpcData) {
Runnable command = new Runnable() {

@Override
Expand All @@ -252,27 +250,8 @@ public void run() {
listener.popupErrorWindow(Res.get("shared.account.wallet.popup.error.startupFailed"));
}
}

public void fetchLanguages(WalletBalanceListener listener, ComboBox<String> languageComboBox) {
log.debug("createWalletRpcInstance - {}, {}");
ObservableList<String> languageOptions = FXCollections.observableArrayList();
Runnable command = new Runnable() {

@Override
public void run() {
checkNotNull(walletRpc, Res.get("mainView.networkWarning.localhostLost", "Monero"));
languageOptions.addAll(walletRpc.getLanguages());
languageComboBox.setItems(languageOptions);
}
};
try {
Platform.runLater(command);
} catch (Exception e) {
listener.popupErrorWindow(Res.get("shared.account.wallet.popup.error.startupFailed"));
}
}

public void openWalletRpcInstance(WalletBalanceListener listener) {
public void openWalletRpcInstance(WalletUiListener listener) {
log.debug("openWalletRpcInstance - {}, {}", HOST, PORT);
Thread checkIfXmrLocalHostNodeIsRunningThread = new Thread(() -> {
Thread.currentThread().setName("checkIfXmrLocalHostNodeIsRunningThread");
Expand Down Expand Up @@ -306,40 +285,6 @@ public void openWalletRpcInstance(WalletBalanceListener listener) {
public boolean isXmrWalletRpcRunning() {
return xmrWalletRpcRunning;
}

public void createWalletRpcInstance(WalletBalanceListener listener, String walletFile, String password, String language, TextArea seedWordsTextArea) {
log.debug("createWalletRpcInstance - {}, {}, {}, {}", HOST, PORT, walletFile, password);
Thread checkIfXmrLocalHostNodeIsRunningThread = new Thread(() -> {
Thread.currentThread().setName("checkIfXmrLocalHostNodeIsRunningThread");
Socket socket = null;
try {
socket = new Socket();
socket.connect(new InetSocketAddress(InetAddresses.forString(HOST), PORT), 5000);
log.debug("Localhost Monero Wallet RPC detected.");
UserThread.execute(() -> {
xmrWalletRpcRunning = true;
walletRpc = new MoneroWalletRpc(new MoneroRpcConnection("http://" + HOST + ":" + PORT));
walletRpc.createWalletRandom(walletFile, password, language);
String mnemonic = walletRpc.getMnemonic();
seedWordsTextArea.setText(mnemonic);
});
} catch (Throwable e) {
log.debug("createWalletRpcInstance - {}", e.getMessage());
e.printStackTrace();
if(listener != null) {
listener.popupErrorWindow(Res.get("shared.account.wallet.popup.error.startupFailed", "Monero", e.getLocalizedMessage()));
}
} finally {
if (socket != null) {
try {
socket.close();
} catch (IOException ignore) {
}
}
}
});
checkIfXmrLocalHostNodeIsRunningThread.start();
}

public void handleTxProof(TxProofHandler handler, String txId, String message) {
Runnable command = new Runnable() {
Expand Down
Expand Up @@ -19,7 +19,7 @@

import java.util.HashMap;

public interface WalletBalanceListener {
public interface WalletUiListener {
/**
*
* @param walletRpcData
Expand Down
Expand Up @@ -14,14 +14,14 @@
import bisq.core.locale.Res;
import bisq.core.xmr.XmrFormatter;
import bisq.core.xmr.wallet.XmrWalletRpcWrapper;
import bisq.core.xmr.wallet.listeners.WalletBalanceListener;
import bisq.core.xmr.wallet.listeners.WalletUiListener;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;

public class XmrBalanceUtil implements WalletBalanceListener {
public class XmrBalanceUtil implements WalletUiListener {
// Displaying general XMR info
private TextField actualBalanceTextField, unlockedBalanceTextField;
private XmrWalletRpcWrapper walletWrapper;
Expand Down
Expand Up @@ -28,7 +28,7 @@
import bisq.common.util.Tuple3;
import bisq.core.locale.Res;
import bisq.core.xmr.wallet.XmrWalletRpcWrapper;
import bisq.core.xmr.wallet.listeners.WalletBalanceListener;
import bisq.core.xmr.wallet.listeners.WalletUiListener;
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
import bisq.desktop.components.BusyAnimation;
Expand All @@ -43,7 +43,7 @@
import javafx.scene.layout.VBox;

@FxmlView
public class XmrReceiveView extends ActivatableView<GridPane, Void> implements WalletBalanceListener {
public class XmrReceiveView extends ActivatableView<GridPane, Void> implements WalletUiListener {

private WalletAddressTextField addressTextField;
private final XmrWalletRpcWrapper walletWrapper;
Expand Down
Expand Up @@ -36,7 +36,7 @@
import bisq.core.locale.Res;
import bisq.core.xmr.XmrFormatter;
import bisq.core.xmr.wallet.XmrWalletRpcWrapper;
import bisq.core.xmr.wallet.listeners.WalletBalanceListener;
import bisq.core.xmr.wallet.listeners.WalletUiListener;
import bisq.desktop.Navigation;
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
Expand Down Expand Up @@ -64,7 +64,7 @@
import monero.wallet.model.MoneroTxWallet;

@FxmlView
public class XmrSendView extends ActivatableView<GridPane, Void> implements WalletBalanceListener {
public class XmrSendView extends ActivatableView<GridPane, Void> implements WalletUiListener {
private final XmrWalletRpcWrapper walletWrapper;
private final XmrFormatter xmrFormatter;
private final Navigation navigation;
Expand Down
Expand Up @@ -28,7 +28,7 @@
import bisq.core.xmr.XmrFormatter;
import bisq.core.xmr.wallet.XmrTxListItem;
import bisq.core.xmr.wallet.XmrWalletRpcWrapper;
import bisq.core.xmr.wallet.listeners.WalletBalanceListener;
import bisq.core.xmr.wallet.listeners.WalletUiListener;
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
import bisq.desktop.components.AutoTooltipTableColumn;
Expand Down Expand Up @@ -59,7 +59,7 @@
import monero.wallet.model.MoneroTxWallet;

@FxmlView
public class XmrTxView extends ActivatableView<GridPane, Void> implements WalletBalanceListener {
public class XmrTxView extends ActivatableView<GridPane, Void> implements WalletUiListener {

private TableView<XmrTxListItem> tableView;
private final XmrWalletRpcWrapper walletWrapper;
Expand Down