diff --git a/drongo b/drongo index 687e235c..4e7f0611 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 687e235c94ef181a8de6ee1fb9cf812d6e16c672 +Subproject commit 4e7f0611c4bd15ae983bd06feeb80ad69eedb853 diff --git a/src/main/java/com/sparrowwallet/sparrow/BitcoinUnit.java b/src/main/java/com/sparrowwallet/sparrow/BitcoinUnit.java deleted file mode 100644 index 56319cca..00000000 --- a/src/main/java/com/sparrowwallet/sparrow/BitcoinUnit.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sparrowwallet.sparrow; - -import com.sparrowwallet.drongo.protocol.Transaction; - -public enum BitcoinUnit { - BTC("BTC") { - @Override - public long getSatsValue(double unitValue) { - return (long)(unitValue * Transaction.SATOSHIS_PER_BITCOIN); - } - - public double getValue(long satsValue) { - return (double)satsValue / Transaction.SATOSHIS_PER_BITCOIN; - } - }, - SATOSHIS("sats") { - @Override - public long getSatsValue(double unitValue) { - return (long)unitValue; - } - - public double getValue(long satsValue) { - return (double)satsValue; - } - }; - - private final String label; - - BitcoinUnit(String label) { - this.label = label; - } - - public String getLabel() { - return label; - } - - public abstract long getSatsValue(double unitValue); - - public abstract double getValue(long satsValue); - - public double convertFrom(double fromValue, BitcoinUnit fromUnit) { - long satsValue = fromUnit.getSatsValue(fromValue); - return getValue(satsValue); - } - - @Override - public String toString() { - return label; - } -} diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index d725f6ac..aaff4cc8 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -1,11 +1,11 @@ package com.sparrowwallet.sparrow.wallet; import com.google.common.eventbus.Subscribe; +import com.sparrowwallet.drongo.BitcoinUnit; import com.sparrowwallet.drongo.address.Address; import com.sparrowwallet.drongo.address.InvalidAddressException; import com.sparrowwallet.drongo.wallet.*; import com.sparrowwallet.sparrow.AppController; -import com.sparrowwallet.sparrow.BitcoinUnit; import com.sparrowwallet.sparrow.EventManager; import com.sparrowwallet.sparrow.control.*; import com.sparrowwallet.sparrow.event.FeeRatesUpdatedEvent; diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml index 850d0e0a..03f4c74b 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml @@ -14,11 +14,11 @@ - +