rename tld

This commit is contained in:
Craig Raw
2020-04-01 13:26:40 +02:00
parent 97de5ef6dc
commit 0e7681f7d1
40 changed files with 157 additions and 92 deletions
@@ -1,7 +0,0 @@
package com.craigraw.sparrow;
import com.craigraw.drongo.protocol.Transaction;
public interface TransactionListener {
void updated(Transaction transaction);
}
@@ -1,9 +1,9 @@
package com.craigraw.sparrow;
package com.sparrowwallet.sparrow;
import com.craigraw.drongo.Utils;
import com.craigraw.drongo.protocol.Transaction;
import com.craigraw.drongo.psbt.PSBT;
import com.craigraw.drongo.psbt.PSBTParseException;
import com.sparrowwallet.drongo.Utils;
import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.psbt.PSBT;
import com.sparrowwallet.drongo.psbt.PSBTParseException;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
@@ -13,7 +13,6 @@ import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import org.bouncycastle.util.encoders.Hex;
import java.io.File;
import java.io.FileInputStream;
@@ -1,6 +1,6 @@
package com.craigraw.sparrow;
package com.sparrowwallet.sparrow;
import com.craigraw.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.protocol.Transaction;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package com.craigraw.sparrow;
package com.sparrowwallet.sparrow;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
@@ -1,8 +1,9 @@
package com.craigraw.sparrow;
package com.sparrowwallet.sparrow;
import com.craigraw.drongo.protocol.*;
import com.craigraw.drongo.psbt.PSBT;
import com.craigraw.sparrow.form.*;
import com.sparrowwallet.drongo.Utils;
import com.sparrowwallet.drongo.protocol.*;
import com.sparrowwallet.drongo.psbt.PSBT;
import com.sparrowwallet.sparrow.form.*;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
@@ -12,7 +13,6 @@ import javafx.scene.control.TreeView;
import javafx.scene.control.cell.TextFieldTreeCell;
import javafx.scene.layout.Pane;
import javafx.util.StringConverter;
import org.bouncycastle.util.encoders.Hex;
import org.fxmisc.richtext.CodeArea;
import java.io.ByteArrayOutputStream;
@@ -110,7 +110,7 @@ public class TransactionController implements Initializable, TransactionListener
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
transaction.bitcoinSerializeToStream(baos);
hex = Hex.toHexString(baos.toByteArray());
hex = Utils.bytesToHex(baos.toByteArray());
} catch(IOException e) {
throw new IllegalStateException("Can't happen");
}
@@ -0,0 +1,7 @@
package com.sparrowwallet.sparrow;
import com.sparrowwallet.drongo.protocol.Transaction;
public interface TransactionListener {
void updated(Transaction transaction);
}
@@ -1,4 +1,4 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import javafx.scene.Node;
@@ -1,8 +1,8 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.address.Address;
import com.craigraw.drongo.protocol.TransactionOutput;
import com.craigraw.drongo.protocol.NonStandardScriptException;
import com.sparrowwallet.drongo.address.Address;
import com.sparrowwallet.drongo.protocol.TransactionOutput;
import com.sparrowwallet.drongo.protocol.NonStandardScriptException;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.chart.PieChart;
@@ -1,8 +1,8 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.Transaction;
import com.craigraw.sparrow.EventManager;
import com.craigraw.sparrow.TransactionListener;
import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.sparrow.EventManager;
import com.sparrowwallet.sparrow.TransactionListener;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
@@ -29,7 +29,10 @@ public class HeadersController implements Initializable, TransactionListener {
private TextField segwit;
@FXML
private ToggleGroup locktimeType;
private ToggleGroup locktimeToggleGroup;
@FXML
private ToggleButton locktimeNoneType;
@FXML
private ToggleButton locktimeBlockType;
@@ -94,13 +97,22 @@ public class HeadersController implements Initializable, TransactionListener {
}
segwit.setText(type);
locktimeType.selectedToggleProperty().addListener((ov, old_toggle, new_toggle) -> {
if(locktimeType.getSelectedToggle() != null) {
String selection = locktimeType.getSelectedToggle().getUserData().toString();
if(selection.equals("block")) {
locktimeToggleGroup.selectedToggleProperty().addListener((ov, old_toggle, new_toggle) -> {
if(locktimeToggleGroup.getSelectedToggle() != null) {
String selection = locktimeToggleGroup.getSelectedToggle().getUserData().toString();
if(selection.equals("none")) {
locktimeFieldset.getChildren().remove(locktimeDateField);
locktimeFieldset.getChildren().remove(locktimeBlockField);
locktimeFieldset.getChildren().add(locktimeBlockField);
locktimeBlock.setDisable(true);
locktimeBlock.getValueFactory().setValue(0);
tx.setLockTime(0);
EventManager.get().notify(tx);
} else if(selection.equals("block")) {
locktimeFieldset.getChildren().remove(locktimeDateField);
locktimeFieldset.getChildren().remove(locktimeBlockField);
locktimeFieldset.getChildren().add(locktimeBlockField);
locktimeBlock.setDisable(false);
Integer block = locktimeBlock.getValue();
if(block != null) {
tx.setLockTime(block);
@@ -121,12 +133,17 @@ public class HeadersController implements Initializable, TransactionListener {
if(tx.getLockTime() < MAX_BLOCK_LOCKTIME) {
locktimeBlock.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, (int)MAX_BLOCK_LOCKTIME-1, (int)tx.getLockTime()));
locktimeType.selectToggle(locktimeBlockType);
if(tx.getLockTime() == 0) {
locktimeToggleGroup.selectToggle(locktimeNoneType);
locktimeBlock.setDisable(true);
} else {
locktimeToggleGroup.selectToggle(locktimeBlockType);
}
} else {
locktimeBlock.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, (int)MAX_BLOCK_LOCKTIME-1));
LocalDateTime date = Instant.ofEpochSecond(tx.getLockTime()).atZone(ZoneId.systemDefault()).toLocalDateTime();
locktimeDate.setDateTimeValue(date);
locktimeType.selectToggle(locktimeDateType);
locktimeToggleGroup.selectToggle(locktimeDateType);
}
locktimeBlock.valueProperty().addListener((obs, oldValue, newValue) -> {
@@ -1,7 +1,7 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.Transaction;
import com.craigraw.drongo.psbt.PSBT;
import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.psbt.PSBT;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
@@ -1,4 +1,4 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import javafx.fxml.Initializable;
@@ -1,6 +1,6 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.TransactionInput;
import com.sparrowwallet.drongo.protocol.TransactionInput;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
@@ -1,7 +1,7 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.*;
import com.craigraw.drongo.psbt.PSBTInput;
import com.sparrowwallet.drongo.protocol.*;
import com.sparrowwallet.drongo.psbt.PSBTInput;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.chart.PieChart;
@@ -1,7 +1,7 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.Transaction;
import com.craigraw.drongo.psbt.PSBT;
import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.psbt.PSBT;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
@@ -1,4 +1,4 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import javafx.fxml.Initializable;
@@ -1,6 +1,6 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.TransactionOutput;
import com.sparrowwallet.drongo.protocol.TransactionOutput;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
@@ -1,7 +1,7 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.Transaction;
import com.craigraw.drongo.protocol.TransactionOutput;
import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.protocol.TransactionOutput;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.chart.PieChart;
@@ -1,6 +1,6 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.protocol.Transaction;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
@@ -1,4 +1,4 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import javafx.fxml.Initializable;
@@ -1,6 +1,6 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.psbt.PSBTInput;
import com.sparrowwallet.drongo.psbt.PSBTInput;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
@@ -1,4 +1,4 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import javafx.fxml.Initializable;
@@ -1,6 +1,6 @@
package com.craigraw.sparrow.form;
package com.sparrowwallet.sparrow.form;
import com.craigraw.drongo.psbt.PSBTOutput;
import com.sparrowwallet.drongo.psbt.PSBTOutput;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;