mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Reformat and organize imports
This commit is contained in:
parent
88462c1180
commit
2d89453736
5
pom.xml
5
pom.xml
@ -87,7 +87,7 @@
|
||||
<artifactId>bcpg-jdk15on</artifactId>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -109,7 +109,8 @@
|
||||
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
|
||||
<minimizeJar>false</minimizeJar>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<manifestEntries>
|
||||
<Main-Class>bisq.desktop.app.BisqAppMain</Main-Class>
|
||||
<!-- the specified bouncy castle jar classes -->
|
||||
|
@ -39,16 +39,16 @@ bg color of non edit textFields: fafafa
|
||||
-bs-bg-grey: #dddddd; /* 25 usages */
|
||||
-bs-bg-grey2: #bbb; /* 1 usages */
|
||||
-bs-bg-grey3: #d3d3d3; /* 1 usages */
|
||||
-bs-dark-grey:#999; /* 8 usages */
|
||||
-bs-dark-grey: #999; /* 8 usages */
|
||||
-bs-light-grey: #cccccc; /* derive(-bs-white, -20%); 13 usages */
|
||||
-bs-content-bg-grey: #f4f4f4; /* 14 usages */
|
||||
-bs-very-light-grey: #f8f8f8; /* 10 usages */
|
||||
-bs-bg-light: #FAFAFA; /* derive(-bs-white, -2%) 4 usages */
|
||||
-bs-very-light-grey:#F0F0F0; /* derive(-bs-white, -6%) 10 usages */
|
||||
-bs-very-light-grey: #F0F0F0; /* derive(-bs-white, -6%) 10 usages */
|
||||
-bs-very-dark-grey: #3c3c3c; /* 8 usages */
|
||||
-bs-very-dark-grey2: #111; /* 1 usages */
|
||||
-bs-black-transparent: rgba(0, 0, 0, 0.5); /* 1 usages */
|
||||
-bs-light-grey2: #cfcfcf;/* 2 usages */
|
||||
-bs-light-grey2: #cfcfcf; /* 2 usages */
|
||||
-bs-light-grey3: #b5b5b5; /* 1 usages */
|
||||
-bs-bg-grey4: #f6f6f6; /* 1 usages */
|
||||
-bs-black: #000000; /* 13 usages */
|
||||
@ -70,8 +70,8 @@ bg color of non edit textFields: fafafa
|
||||
-bs-yellow: #ffb60f; /* 2 usages */
|
||||
-bs-yellow-light: derive(-bs-yellow, 81%);
|
||||
-bs-bg-grey8: #E1E9E1; /* 1 usages */
|
||||
-bs-bg-green2:#619865; /* 2 usages */
|
||||
-bs-bg-green:#99ba9c; /* 4 usages */
|
||||
-bs-bg-green2: #619865; /* 2 usages */
|
||||
-bs-bg-green: #99ba9c; /* 4 usages */
|
||||
-bs-green: #00aa33; /* 6 usages */
|
||||
-bs-turquoise: #2cacaf; /* 1 usages */
|
||||
-bs-bg-grey5: #f1f6f7; /* 4 usages */
|
||||
@ -208,7 +208,6 @@ bg color of non edit textFields: fafafa
|
||||
-fx-font-size: 13;
|
||||
}
|
||||
|
||||
|
||||
/* Splash */
|
||||
|
||||
#splash {
|
||||
@ -346,7 +345,6 @@ bg color of non edit textFields: fafafa
|
||||
-fx-text-fill: -fx-accent;
|
||||
}
|
||||
|
||||
|
||||
.dao-tx-type-received-funds-icon,
|
||||
.dao-tx-type-received-funds-icon:hover {
|
||||
-fx-text-fill: -bs-green-soft;
|
||||
@ -379,7 +377,6 @@ bg color of non edit textFields: fafafa
|
||||
-fx-cursor: hand;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Tooltip *
|
||||
@ -413,8 +410,7 @@ textfield */
|
||||
.hyperlink:hover,
|
||||
.hyperlink:visited,
|
||||
.hyperlink:hover:visited,
|
||||
.hyperlink:focused
|
||||
{
|
||||
.hyperlink:focused {
|
||||
-fx-border-style: none;
|
||||
-fx-border-width: 0px;
|
||||
}
|
||||
@ -1294,8 +1290,8 @@ textfield */
|
||||
}
|
||||
|
||||
.message-header {
|
||||
-fx-text-fill: -bs-light-grey;
|
||||
-fx-font-size: 0.846em;
|
||||
-fx-text-fill: -bs-light-grey;
|
||||
-fx-font-size: 0.846em;
|
||||
}
|
||||
|
||||
/********************************************************************************************************************
|
||||
|
@ -19,7 +19,7 @@ package bisq.desktop.components;
|
||||
|
||||
import javafx.scene.control.TableColumn;
|
||||
|
||||
public class AutoTooltipTableColumn<S,T> extends TableColumn<S,T> {
|
||||
public class AutoTooltipTableColumn<S, T> extends TableColumn<S, T> {
|
||||
|
||||
public AutoTooltipTableColumn(String text) {
|
||||
super();
|
||||
|
@ -33,7 +33,7 @@ public class ColoredDecimalPlacesWithZerosText extends HBox {
|
||||
super();
|
||||
|
||||
if (numberOfZerosToColorize <= 0) {
|
||||
getChildren().addAll(new Text(number));
|
||||
getChildren().addAll(new Text(number));
|
||||
} else if (number.contains(GUIUtil.RANGE_SEPARATOR)) {
|
||||
String[] splitNumber = number.split(GUIUtil.RANGE_SEPARATOR);
|
||||
Tuple2<Label, Label> numbers = getSplittedNumberNodes(splitNumber[0], numberOfZerosToColorize);
|
||||
|
@ -33,7 +33,7 @@ public class TooltipUtil {
|
||||
if (labeled.getTooltip() != null) {
|
||||
labeled.setTooltip(null);
|
||||
}
|
||||
} else if (untruncatedText != null && !untruncatedText.trim().isEmpty()){
|
||||
} else if (untruncatedText != null && !untruncatedText.trim().isEmpty()) {
|
||||
labeled.setTooltip(new Tooltip(untruncatedText));
|
||||
}
|
||||
}
|
||||
|
@ -441,8 +441,8 @@ public class StaticProgressIndicatorSkin extends BehaviorSkinBase<TxConfidenceIn
|
||||
final double bottom = snapSize(controlInsets.getBottom());
|
||||
|
||||
/*
|
||||
** use the min of width, or height, keep it a circle
|
||||
*/
|
||||
** use the min of width, or height, keep it a circle
|
||||
*/
|
||||
final double areaW = control.getWidth() - left - right;
|
||||
final double areaH = control.getHeight() - top - bottom /*- textGap - doneTextHeight*/;
|
||||
final double radiusW = areaW / 2;
|
||||
|
@ -652,7 +652,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||
});
|
||||
setBottomAnchor(versionLabel, 7d);
|
||||
model.newVersionAvailableProperty.addListener((observable, oldValue, newValue) -> {
|
||||
versionLabel.getStyleClass().removeAll("version-new","version");
|
||||
versionLabel.getStyleClass().removeAll("version-new", "version");
|
||||
if (newValue) {
|
||||
versionLabel.getStyleClass().add("version-new");
|
||||
versionLabel.setOnMouseClicked(e -> model.openDownloadWindow());
|
||||
|
@ -86,8 +86,8 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
|
||||
private void fillAndSortPaymentAccounts() {
|
||||
if (user.getPaymentAccounts() != null) {
|
||||
paymentAccounts.setAll(user.getPaymentAccounts().stream()
|
||||
.filter(paymentAccount -> paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.BLOCK_CHAINS_ID))
|
||||
.collect(Collectors.toList()));
|
||||
.filter(paymentAccount -> paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.BLOCK_CHAINS_ID))
|
||||
.collect(Collectors.toList()));
|
||||
paymentAccounts.sort((o1, o2) -> o1.getCreationDate().compareTo(o2.getCreationDate()));
|
||||
}
|
||||
}
|
||||
@ -126,14 +126,14 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
|
||||
|
||||
public boolean onDeleteAccount(PaymentAccount paymentAccount) {
|
||||
boolean isPaymentAccountUsed = openOfferManager.getObservableList().stream()
|
||||
.filter(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()))
|
||||
.findAny()
|
||||
.isPresent();
|
||||
.filter(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()))
|
||||
.findAny()
|
||||
.isPresent();
|
||||
isPaymentAccountUsed = isPaymentAccountUsed || tradeManager.getTradableList().stream()
|
||||
.filter(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) ||
|
||||
paymentAccount.getId().equals(t.getTakerPaymentAccountId()))
|
||||
.findAny()
|
||||
.isPresent();
|
||||
.filter(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) ||
|
||||
paymentAccount.getId().equals(t.getTakerPaymentAccountId()))
|
||||
.findAny()
|
||||
.isPresent();
|
||||
if (!isPaymentAccountUsed)
|
||||
user.removePaymentAccount(paymentAccount);
|
||||
return isPaymentAccountUsed;
|
||||
@ -146,8 +146,8 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
|
||||
public void exportAccounts() {
|
||||
if (user.getPaymentAccounts() != null) {
|
||||
ArrayList<PaymentAccount> accounts = new ArrayList<>(user.getPaymentAccounts().stream()
|
||||
.filter(paymentAccount -> paymentAccount instanceof CryptoCurrencyAccount)
|
||||
.collect(Collectors.toList()));
|
||||
.filter(paymentAccount -> paymentAccount instanceof CryptoCurrencyAccount)
|
||||
.collect(Collectors.toList()));
|
||||
GUIUtil.exportAccounts(accounts, accountsFileName, preferences, stage, persistenceProtoResolver);
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class CompensationViewItem {
|
||||
DoubleProperty labelWidth,
|
||||
BsqFormatter bsqFormatter,
|
||||
Runnable removeHandler) {
|
||||
instances.add(new CompensationViewItem(compensationRequestVoteItem,bsqWalletService, vBox, bsqFormatter, removeHandler));
|
||||
instances.add(new CompensationViewItem(compensationRequestVoteItem, bsqWalletService, vBox, bsqFormatter, removeHandler));
|
||||
}
|
||||
|
||||
public static void cleanupAllInstances() {
|
||||
|
@ -239,12 +239,12 @@ public class BsqTxView extends ActivatableView<GridPane, Void> {
|
||||
final List<Transaction> walletTransactions = new ArrayList<>(bsqWalletService.getWalletTransactions());
|
||||
Set<BsqTxListItem> items = walletTransactions.stream()
|
||||
.map(transaction -> new BsqTxListItem(transaction,
|
||||
bsqWalletService,
|
||||
btcWalletService,
|
||||
bsqBlockChain.getTxType(transaction.getHashAsString()),
|
||||
bsqBlockChain.hasTxBurntFee(transaction.getHashAsString()),
|
||||
bsqBlockChain,
|
||||
bsqFormatter)
|
||||
bsqWalletService,
|
||||
btcWalletService,
|
||||
bsqBlockChain.getTxType(transaction.getHashAsString()),
|
||||
bsqBlockChain.hasTxBurntFee(transaction.getHashAsString()),
|
||||
bsqBlockChain,
|
||||
bsqFormatter)
|
||||
)
|
||||
.collect(Collectors.toSet());
|
||||
observableList.setAll(items);
|
||||
|
@ -798,7 +798,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||
arrow.setManaged(!item.isSystemMessage());
|
||||
statusIcon.setVisible(false);
|
||||
if (item.isSystemMessage()) {
|
||||
headerLabel.getStyleClass().addAll("message-header","success-text");
|
||||
headerLabel.getStyleClass().addAll("message-header", "success-text");
|
||||
bg.setId("message-bubble-green");
|
||||
messageLabel.getStyleClass().add("my-message");
|
||||
copyIcon.getStyleClass().add("my-message");
|
||||
@ -973,7 +973,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private TableColumn<Dispute, Dispute> getSelectColumn() {
|
||||
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute,Dispute>(Res.get("shared.select"));
|
||||
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.select"));
|
||||
column.setMinWidth(80);
|
||||
column.setMaxWidth(80);
|
||||
column.setSortable(false);
|
||||
|
@ -609,7 +609,8 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
|
||||
checkBox.setSelected(item.isSelected());
|
||||
} else {
|
||||
checkBox.setOnAction(null);
|
||||
setGraphic(null); }
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||
|
||||
bisqWindowVerticalSizeListener = (observable, oldValue, newValue) -> {
|
||||
double newTableViewHeight = offerTableViewHeight.apply(newValue.doubleValue());
|
||||
if(buyOfferTableView.getHeight() != newTableViewHeight) {
|
||||
if (buyOfferTableView.getHeight() != newTableViewHeight) {
|
||||
buyOfferTableView.setMinHeight(newTableViewHeight);
|
||||
sellOfferTableView.setMinHeight(newTableViewHeight);
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ class TradesChartsViewModel extends ActivatableViewModel {
|
||||
Pair<Date, Set<TradeStatistics2>> pair = new Pair<>((Date) time.clone(), set);
|
||||
itemsPerInterval.put(i, pair);
|
||||
time.setTime(time.getTime() - 1);
|
||||
time = roundToTick(time, tickUnit);
|
||||
time = roundToTick(time, tickUnit);
|
||||
}
|
||||
|
||||
// Get all entries for the defined time interval
|
||||
|
@ -46,6 +46,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package bisq.desktop.main.market.trades.charts.price;
|
||||
|
||||
import bisq.desktop.main.market.trades.charts.CandleData;
|
||||
@ -120,9 +121,9 @@ public class Candle extends Group {
|
||||
style = "empty";
|
||||
|
||||
highLowLine.getStyleClass().setAll("candlestick-line", seriesStyleClass, dataStyleClass,
|
||||
style);
|
||||
style);
|
||||
|
||||
bar.getStyleClass().setAll("candlestick-bar", seriesStyleClass, dataStyleClass,
|
||||
style);
|
||||
style);
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package bisq.desktop.main.market.trades.charts.price;
|
||||
|
||||
import bisq.desktop.main.market.trades.charts.CandleData;
|
||||
|
@ -46,6 +46,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package bisq.desktop.main.market.trades.charts.price;
|
||||
|
||||
import bisq.desktop.components.AutoTooltipLabel;
|
||||
|
@ -14,6 +14,7 @@
|
||||
* 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.desktop.main.market.trades.charts.volume;
|
||||
|
||||
import bisq.desktop.main.market.trades.charts.CandleData;
|
||||
|
@ -14,6 +14,7 @@
|
||||
* 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.desktop.main.market.trades.charts.volume;
|
||||
|
||||
import bisq.desktop.main.market.trades.charts.CandleData;
|
||||
|
@ -735,7 +735,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
||||
// field wasn't set manually
|
||||
inputIsMarketBasedPrice = true;
|
||||
}
|
||||
marketPriceMargin.set(btcFormatter.formatRoundedDoubleWithPrecision(dataModel.getMarketPriceMargin() * 100, 2));
|
||||
marketPriceMargin.set(btcFormatter.formatRoundedDoubleWithPrecision(dataModel.getMarketPriceMargin() * 100, 2));
|
||||
}
|
||||
|
||||
void onFocusOutVolumeTextField(boolean oldValue, boolean newValue) {
|
||||
|
@ -82,7 +82,7 @@ public class OfferBook {
|
||||
|
||||
offerBookListItems.add(offerBookListItem);
|
||||
Log.logIfStressTests("OfferPayload added: No. of offers = " + offerBookListItems.size());
|
||||
}else{
|
||||
} else {
|
||||
log.debug("We have the exact same offer already in our list and ignore the onAdded call. ID={}", offer.getId());
|
||||
}
|
||||
}
|
||||
|
@ -178,13 +178,13 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||
if (highestAmountOffer.isPresent()) {
|
||||
final OfferBookListItem item = highestAmountOffer.get();
|
||||
if (!item.getOffer().isRange() && containsRangeAmount) {
|
||||
maxPlacesForAmount.set(formatAmount(item.getOffer(),false)
|
||||
maxPlacesForAmount.set(formatAmount(item.getOffer(), false)
|
||||
.length() * 2 + GUIUtil.RANGE_SEPARATOR.length());
|
||||
maxPlacesForVolume.set(formatVolume(item.getOffer(),false)
|
||||
maxPlacesForVolume.set(formatVolume(item.getOffer(), false)
|
||||
.length() * 2 + GUIUtil.RANGE_SEPARATOR.length());
|
||||
} else {
|
||||
maxPlacesForAmount.set(formatAmount(item.getOffer(),false).length());
|
||||
maxPlacesForVolume.set(formatVolume(item.getOffer(),false).length());
|
||||
maxPlacesForAmount.set(formatAmount(item.getOffer(), false).length());
|
||||
maxPlacesForVolume.set(formatVolume(item.getOffer(), false).length());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -560,7 +560,9 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
|
||||
return dataModel.getOffer();
|
||||
}
|
||||
|
||||
public boolean isRange() {return dataModel.getOffer().isRange(); }
|
||||
public boolean isRange() {
|
||||
return dataModel.getOffer().isRange();
|
||||
}
|
||||
|
||||
public String getAmountRange() {
|
||||
return amountRange;
|
||||
|
@ -182,8 +182,8 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
private void addContent() {
|
||||
FormBuilder.addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.onionAddress"), hostName).second.setMouseTransparent(false);
|
||||
FormBuilder.addLabelTextField(gridPane, ++rowIndex,
|
||||
Res.get("peerInfo.nrOfTrades"),
|
||||
numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet"));
|
||||
Res.get("peerInfo.nrOfTrades"),
|
||||
numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet"));
|
||||
if (accountAge != null)
|
||||
FormBuilder.addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("peerInfo.age"), accountAge);
|
||||
|
||||
@ -195,8 +195,8 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
keyEventEventHandler = event -> {
|
||||
if (Utilities.isAltOrCtrlPressed(KeyCode.R, event)) {
|
||||
new SendPrivateNotificationWindow(offer.getPubKeyRing(), offer.getMakerNodeAddress(), useDevPrivilegeKeys)
|
||||
.onAddAlertMessage(privateNotificationManager::sendPrivateNotificationMessageIfKeyIsValid)
|
||||
.show();
|
||||
.onAddAlertMessage(privateNotificationManager::sendPrivateNotificationMessageIfKeyIsValid)
|
||||
.show();
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -233,12 +233,12 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
Timeline timeline = new Timeline();
|
||||
ObservableList<KeyFrame> keyFrames = timeline.getKeyFrames();
|
||||
keyFrames.add(new KeyFrame(Duration.millis(0),
|
||||
new KeyValue(gridPane.rotateProperty(), 0, interpolator),
|
||||
new KeyValue(gridPane.opacityProperty(), 1, interpolator)
|
||||
new KeyValue(gridPane.rotateProperty(), 0, interpolator),
|
||||
new KeyValue(gridPane.opacityProperty(), 1, interpolator)
|
||||
));
|
||||
keyFrames.add(new KeyFrame(Duration.millis(duration),
|
||||
new KeyValue(gridPane.rotateProperty(), -90, interpolator),
|
||||
new KeyValue(gridPane.opacityProperty(), 0, interpolator)
|
||||
new KeyValue(gridPane.rotateProperty(), -90, interpolator),
|
||||
new KeyValue(gridPane.opacityProperty(), 0, interpolator)
|
||||
));
|
||||
timeline.setOnFinished(event -> {
|
||||
gridPane.setRotate(0);
|
||||
@ -261,13 +261,13 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
|
||||
Timeline timeline = new Timeline();
|
||||
ObservableList<KeyFrame> keyFrames = timeline.getKeyFrames();
|
||||
keyFrames.add(new KeyFrame(Duration.millis(0),
|
||||
new KeyValue(gridPane.opacityProperty(), 0, interpolator),
|
||||
new KeyValue(gridPane.translateYProperty(), startY, interpolator)
|
||||
new KeyValue(gridPane.opacityProperty(), 0, interpolator),
|
||||
new KeyValue(gridPane.translateYProperty(), startY, interpolator)
|
||||
));
|
||||
|
||||
keyFrames.add(new KeyFrame(Duration.millis(duration),
|
||||
new KeyValue(gridPane.opacityProperty(), 1, interpolator),
|
||||
new KeyValue(gridPane.translateYProperty(), 0, interpolator)
|
||||
new KeyValue(gridPane.opacityProperty(), 1, interpolator),
|
||||
new KeyValue(gridPane.translateYProperty(), 0, interpolator)
|
||||
));
|
||||
|
||||
timeline.play();
|
||||
|
@ -121,7 +121,7 @@ public class NotificationCenter {
|
||||
log.debug("We have already an entry in disputeStateSubscriptionsMap.");
|
||||
} else {
|
||||
Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(),
|
||||
disputeState -> onDisputeStateChanged(trade, disputeState));
|
||||
disputeState -> onDisputeStateChanged(trade, disputeState));
|
||||
disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription);
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class NotificationCenter {
|
||||
log.debug("We have already an entry in tradePhaseSubscriptionsMap.");
|
||||
} else {
|
||||
Subscription tradePhaseSubscription = EasyBind.subscribe(trade.statePhaseProperty(),
|
||||
phase -> onTradePhaseChanged(trade, phase));
|
||||
phase -> onTradePhaseChanged(trade, phase));
|
||||
tradePhaseSubscriptionsMap.put(tradeId, tradePhaseSubscription);
|
||||
}
|
||||
});
|
||||
@ -137,17 +137,17 @@ public class NotificationCenter {
|
||||
});
|
||||
|
||||
tradeManager.getTradableList().stream()
|
||||
.forEach(trade -> {
|
||||
String tradeId = trade.getId();
|
||||
Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(),
|
||||
disputeState -> onDisputeStateChanged(trade, disputeState));
|
||||
disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription);
|
||||
.forEach(trade -> {
|
||||
String tradeId = trade.getId();
|
||||
Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(),
|
||||
disputeState -> onDisputeStateChanged(trade, disputeState));
|
||||
disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription);
|
||||
|
||||
Subscription tradePhaseSubscription = EasyBind.subscribe(trade.statePhaseProperty(),
|
||||
phase -> onTradePhaseChanged(trade, phase));
|
||||
tradePhaseSubscriptionsMap.put(tradeId, tradePhaseSubscription);
|
||||
}
|
||||
);
|
||||
Subscription tradePhaseSubscription = EasyBind.subscribe(trade.statePhaseProperty(),
|
||||
phase -> onTradePhaseChanged(trade, phase));
|
||||
tradePhaseSubscriptionsMap.put(tradeId, tradePhaseSubscription);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -177,7 +177,7 @@ public class NotificationCenter {
|
||||
message = Res.get("notification.trade.completed");
|
||||
} else {
|
||||
if (trade instanceof MakerTrade &&
|
||||
phase.ordinal() == Trade.Phase.DEPOSIT_PUBLISHED.ordinal()) {
|
||||
phase.ordinal() == Trade.Phase.DEPOSIT_PUBLISHED.ordinal()) {
|
||||
final String role = trade instanceof BuyerTrade ? Res.get("shared.seller") : Res.get("shared.buyer");
|
||||
message = Res.get("notification.trade.accepted", role);
|
||||
}
|
||||
@ -194,24 +194,24 @@ public class NotificationCenter {
|
||||
Notification notification = new Notification().tradeHeadLine(trade.getShortId()).message(message);
|
||||
if (navigation.getCurrentPath() != null && !navigation.getCurrentPath().contains(PendingTradesView.class)) {
|
||||
notification.actionButtonTextWithGoTo("navigation.portfolio.pending")
|
||||
.onAction(() -> {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
//noinspection unchecked
|
||||
navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class);
|
||||
if (selectItemByTradeIdConsumer != null)
|
||||
UserThread.runAfter(() -> selectItemByTradeIdConsumer.accept(trade.getId()), 1);
|
||||
})
|
||||
.onClose(() -> DontShowAgainLookup.dontShowAgain(key, true))
|
||||
.show();
|
||||
.onAction(() -> {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
//noinspection unchecked
|
||||
navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class);
|
||||
if (selectItemByTradeIdConsumer != null)
|
||||
UserThread.runAfter(() -> selectItemByTradeIdConsumer.accept(trade.getId()), 1);
|
||||
})
|
||||
.onClose(() -> DontShowAgainLookup.dontShowAgain(key, true))
|
||||
.show();
|
||||
} else if (selectedTradeId != null && !trade.getId().equals(selectedTradeId)) {
|
||||
notification.actionButtonText(Res.get("notification.trade.selectTrade"))
|
||||
.onAction(() -> {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
if (selectItemByTradeIdConsumer != null)
|
||||
selectItemByTradeIdConsumer.accept(trade.getId());
|
||||
})
|
||||
.onClose(() -> DontShowAgainLookup.dontShowAgain(key, true))
|
||||
.show();
|
||||
.onAction(() -> {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
if (selectItemByTradeIdConsumer != null)
|
||||
selectItemByTradeIdConsumer.accept(trade.getId());
|
||||
})
|
||||
.onClose(() -> DontShowAgainLookup.dontShowAgain(key, true))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -222,8 +222,8 @@ public class NotificationCenter {
|
||||
String message = null;
|
||||
if (disputeManager.findOwnDispute(trade.getId()).isPresent()) {
|
||||
String disputeOrTicket = disputeManager.findOwnDispute(trade.getId()).get().isSupportTicket() ?
|
||||
Res.get("shared.supportTicket") :
|
||||
Res.get("shared.dispute");
|
||||
Res.get("shared.supportTicket") :
|
||||
Res.get("shared.dispute");
|
||||
switch (disputeState) {
|
||||
case NO_DISPUTE:
|
||||
break;
|
||||
@ -241,8 +241,8 @@ public class NotificationCenter {
|
||||
if (navigation.getCurrentPath() != null && !navigation.getCurrentPath().contains(TraderDisputeView.class)) {
|
||||
//noinspection unchecked
|
||||
notification.actionButtonTextWithGoTo("navigation.support")
|
||||
.onAction(() -> navigation.navigateTo(MainView.class, DisputesView.class, TraderDisputeView.class))
|
||||
.show();
|
||||
.onAction(() -> navigation.navigateTo(MainView.class, DisputesView.class, TraderDisputeView.class))
|
||||
.show();
|
||||
} else {
|
||||
notification.show();
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class DisplayAlertMessageWindow extends Overlay<DisplayAlertMessageWindow
|
||||
FormBuilder.addMultilineLabel(gridPane, ++rowIndex, alert.getMessage(), 10);
|
||||
if (alert.isUpdateInfo()) {
|
||||
headLine = Res.get("displayAlertMessageWindow.update.headline");
|
||||
headLineLabel.getStyleClass().addAll("headline-label","highlight");
|
||||
headLineLabel.getStyleClass().addAll("headline-label", "highlight");
|
||||
String url = "https://bisq.network/downloads";
|
||||
HyperlinkWithIcon hyperlinkWithIcon = FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex,
|
||||
Res.get("displayAlertMessageWindow.update.download"), url, url).second;
|
||||
|
@ -215,7 +215,7 @@ public class DisplayUpdateDownloadWindow extends Overlay<DisplayUpdateDownloadWi
|
||||
List<BisqInstaller.FileDescriptor> downloadResults = downloadTask.getValue();
|
||||
Optional<BisqInstaller.FileDescriptor> downloadFailed = downloadResults.stream()
|
||||
.filter(fileDescriptor -> !BisqInstaller.DownloadStatusEnum.OK.equals(fileDescriptor.getDownloadStatus())).findFirst();
|
||||
downloadedFilesLabel.getStyleClass().removeAll("error-text","success-text");
|
||||
downloadedFilesLabel.getStyleClass().removeAll("error-text", "success-text");
|
||||
if (downloadResults == null || downloadResults.isEmpty() || downloadFailed.isPresent()) {
|
||||
showErrorMessage(downloadButton, statusLabel, downloadFailedString);
|
||||
downloadedFilesLabel.getStyleClass().add("error-text");
|
||||
|
@ -54,8 +54,8 @@ public class BuyerStep3View extends TradeStepView {
|
||||
protected String getWarningText() {
|
||||
setInformationHeadline();
|
||||
String substitute = model.isBlockChainMethod() ?
|
||||
Res.get("portfolio.pending.step3_buyer.warn.part1a", model.dataModel.getCurrencyCode()) :
|
||||
Res.get("portfolio.pending.step3_buyer.warn.part1b");
|
||||
Res.get("portfolio.pending.step3_buyer.warn.part1a", model.dataModel.getCurrencyCode()) :
|
||||
Res.get("portfolio.pending.step3_buyer.warn.part1b");
|
||||
return Res.get("portfolio.pending.step3_buyer.warn.part2", substitute, model.getDateForOpenDispute());
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,8 @@ public class SellerStep2View extends TradeStepView {
|
||||
protected String getWarningText() {
|
||||
setInformationHeadline();
|
||||
return Res.get("portfolio.pending.step2_seller.warn",
|
||||
model.dataModel.getCurrencyCode(),
|
||||
model.getDateForOpenDispute());
|
||||
model.dataModel.getCurrencyCode(),
|
||||
model.getDateForOpenDispute());
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -285,9 +285,9 @@ public class BSFormatter {
|
||||
}
|
||||
|
||||
public String formatVolume(Offer offer, Boolean decimalAligned, int maxNumberOfDigits, boolean showRange) {
|
||||
String formattedVolume = offer.isRange() && showRange ? formatVolume(offer.getMinVolume()) + GUIUtil.RANGE_SEPARATOR + formatVolume(offer.getVolume()) : formatVolume(offer.getVolume());
|
||||
String formattedVolume = offer.isRange() && showRange ? formatVolume(offer.getMinVolume()) + GUIUtil.RANGE_SEPARATOR + formatVolume(offer.getVolume()) : formatVolume(offer.getVolume());
|
||||
|
||||
if(decimalAligned) {
|
||||
if (decimalAligned) {
|
||||
formattedVolume = fillUpPlacesWithEmptyStrings(formattedVolume, maxNumberOfDigits);
|
||||
}
|
||||
return formattedVolume;
|
||||
@ -363,7 +363,7 @@ public class BSFormatter {
|
||||
|
||||
public String formatAmount(Offer offer, boolean decimalAligned) {
|
||||
String formattedAmount = offer.isRange() ? formatCoin(offer.getMinAmount()) + GUIUtil.RANGE_SEPARATOR + formatCoin(offer.getAmount()) : formatCoin(offer.getAmount());
|
||||
if(decimalAligned) {
|
||||
if (decimalAligned) {
|
||||
formattedAmount = fillUpPlacesWithEmptyStrings(formattedAmount, 15);
|
||||
}
|
||||
return formattedAmount;
|
||||
@ -372,7 +372,7 @@ public class BSFormatter {
|
||||
public String formatAmount(Offer offer, int decimalPlaces, boolean decimalAligned, int maxPlaces) {
|
||||
String formattedAmount = offer.isRange() ? formatCoin(offer.getMinAmount(), decimalPlaces) + GUIUtil.RANGE_SEPARATOR + formatCoin(offer.getAmount(), decimalPlaces) : formatCoin(offer.getAmount(), decimalPlaces);
|
||||
|
||||
if(decimalAligned) {
|
||||
if (decimalAligned) {
|
||||
formattedAmount = fillUpPlacesWithEmptyStrings(formattedAmount, maxPlaces);
|
||||
}
|
||||
return formattedAmount;
|
||||
@ -403,7 +403,7 @@ public class BSFormatter {
|
||||
public String formatPrice(Price price, Boolean decimalAligned, int maxPlaces) {
|
||||
String formattedPrice = formatPrice(price);
|
||||
|
||||
if(decimalAligned) {
|
||||
if (decimalAligned) {
|
||||
formattedPrice = fillUpPlacesWithEmptyStrings(formattedPrice, maxPlaces);
|
||||
}
|
||||
return formattedPrice;
|
||||
|
@ -832,7 +832,7 @@ public class FormBuilder {
|
||||
FundsTextField fundsTextField = new FundsTextField();
|
||||
GridPane.setRowIndex(fundsTextField, rowIndex);
|
||||
GridPane.setColumnIndex(fundsTextField, 1);
|
||||
GridPane.setMargin(fundsTextField, new Insets(top, 0,0,0));
|
||||
GridPane.setMargin(fundsTextField, new Insets(top, 0, 0, 0));
|
||||
gridPane.getChildren().add(fundsTextField);
|
||||
|
||||
return new Tuple2<>(label, fundsTextField);
|
||||
@ -854,7 +854,7 @@ public class FormBuilder {
|
||||
infoTextField.setText(fieldText);
|
||||
GridPane.setRowIndex(infoTextField, rowIndex);
|
||||
GridPane.setColumnIndex(infoTextField, 1);
|
||||
GridPane.setMargin(infoTextField, new Insets(top, 0,0,0));
|
||||
GridPane.setMargin(infoTextField, new Insets(top, 0, 0, 0));
|
||||
gridPane.getChildren().add(infoTextField);
|
||||
|
||||
return new Tuple2<>(label, infoTextField);
|
||||
|
@ -29,9 +29,9 @@ import org.bitcoinj.utils.MonetaryFormat;
|
||||
|
||||
public class PNCParams extends NetworkParameters {
|
||||
|
||||
private static PNCParams instance;
|
||||
private static PNCParams instance;
|
||||
|
||||
public static synchronized PNCParams get() {
|
||||
public static synchronized PNCParams get() {
|
||||
if (instance == null) {
|
||||
instance = new PNCParams();
|
||||
}
|
||||
@ -42,7 +42,7 @@ public class PNCParams extends NetworkParameters {
|
||||
super();
|
||||
addressHeader = 55;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[] {addressHeader, p2shHeader};
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -90,4 +90,4 @@ public class TerracoinParams extends NetworkParameters {
|
||||
public int getProtocolVersionNum(ProtocolVersion version) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,4 +90,4 @@ public class WACoinsParams extends NetworkParameters {
|
||||
public int getProtocolVersionNum(ProtocolVersion version) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
/**
|
||||
* Parameters for the main production network on which people trade goods and services.
|
||||
*
|
||||
* <p>
|
||||
* We cannot use MainNetParams because that would be one of the other base currencies,
|
||||
* so we cloned the MainNetParams to BtcMainNetParamsForValidation
|
||||
*/
|
||||
@ -120,30 +120,30 @@ public class BtcMainNetParamsForValidation extends AbstractBitcoinNetParams {
|
||||
|
||||
// Updated Nov. 4th 2017
|
||||
addrSeeds = new int[]{
|
||||
// -- seed.bitcoin.sipa.be --
|
||||
0x254187d, 0x1af0735d, 0x20b72088, 0x30a1c321, 0x3515cb9f, 0x4539448a, 0x459caed5,
|
||||
0x4b0559d1, 0x5c88c9c1, 0x726fc523, 0x753b448a, 0x75b25c50, 0x7efc63b3, 0x8e79e849,
|
||||
0x914ff334, 0x93d60bc6, 0x9e1df618, 0xa7069f4b, 0xafbd5827, 0xb5a3ce62, 0xc635d054,
|
||||
0xc6fa4260, 0xc73aea63, 0xc7437558, 0xd78bbfd5,
|
||||
// -- seed.bitcoin.sipa.be --
|
||||
0x254187d, 0x1af0735d, 0x20b72088, 0x30a1c321, 0x3515cb9f, 0x4539448a, 0x459caed5,
|
||||
0x4b0559d1, 0x5c88c9c1, 0x726fc523, 0x753b448a, 0x75b25c50, 0x7efc63b3, 0x8e79e849,
|
||||
0x914ff334, 0x93d60bc6, 0x9e1df618, 0xa7069f4b, 0xafbd5827, 0xb5a3ce62, 0xc635d054,
|
||||
0xc6fa4260, 0xc73aea63, 0xc7437558, 0xd78bbfd5,
|
||||
// -- dnsseed.bluematt.me --
|
||||
0x1a536adb, 0x20ecc692, 0x21117c4c, 0x4060d85b, 0x4a9caed5, 0x513caca3, 0x5a636358,
|
||||
0x675ad655, 0x75c0d4ad, 0xa5e3e8ad, 0xa6531525, 0xac08ab4c, 0xb2d7af41, 0xb4008bb9,
|
||||
0xb5064945, 0xc9fad02f, 0xcb59a28b, 0xd54ba834, 0xe04d0055, 0xed5d5848, 0xfb0a825e,
|
||||
0x1a536adb, 0x20ecc692, 0x21117c4c, 0x4060d85b, 0x4a9caed5, 0x513caca3, 0x5a636358,
|
||||
0x675ad655, 0x75c0d4ad, 0xa5e3e8ad, 0xa6531525, 0xac08ab4c, 0xb2d7af41, 0xb4008bb9,
|
||||
0xb5064945, 0xc9fad02f, 0xcb59a28b, 0xd54ba834, 0xe04d0055, 0xed5d5848, 0xfb0a825e,
|
||||
// -- dnsseed.bitcoin.dashjr.org --
|
||||
0x858ba8c, 0xc201bb9, 0xdded4ad, 0x21fe312d, 0x330fc023, 0x4230b75f, 0x45667a7b,
|
||||
0x47370159, 0x64384e57, 0x67b1b14d, 0x6e2a0f33, 0x810c6e3b, 0x9f3a652e, 0xa0def550,
|
||||
0xab2d2d18, 0xb06a3850, 0xb7df01a9, 0xc8a8825e, 0xd3ace75c, 0xd5a0aa43, 0xdc0d599f,
|
||||
0xe1f00d47, 0xf1519f51, 0xfd83bd56,
|
||||
0x858ba8c, 0xc201bb9, 0xdded4ad, 0x21fe312d, 0x330fc023, 0x4230b75f, 0x45667a7b,
|
||||
0x47370159, 0x64384e57, 0x67b1b14d, 0x6e2a0f33, 0x810c6e3b, 0x9f3a652e, 0xa0def550,
|
||||
0xab2d2d18, 0xb06a3850, 0xb7df01a9, 0xc8a8825e, 0xd3ace75c, 0xd5a0aa43, 0xdc0d599f,
|
||||
0xe1f00d47, 0xf1519f51, 0xfd83bd56,
|
||||
// -- seed.bitcoinstats.com --
|
||||
0x2e1ff68, 0x424bd6b, 0x7571e53, 0x14d33174, 0x18aac780, 0x1c5cd812, 0x40614032,
|
||||
0x40de1c4d, 0x688fd812, 0x73c6ffad, 0x7dc6ffad, 0x7ebd2149, 0x8c08d153, 0x90b5a6d3,
|
||||
0x986fd462, 0xae1c82aa, 0xbeffdc4a, 0xc0a1764b, 0xc0c0b1d3, 0xdff8c768, 0xe0e6a6d3,
|
||||
0xe23b0f34, 0xe35f372f, 0xe9ff4748, 0xeed8b943,
|
||||
0x2e1ff68, 0x424bd6b, 0x7571e53, 0x14d33174, 0x18aac780, 0x1c5cd812, 0x40614032,
|
||||
0x40de1c4d, 0x688fd812, 0x73c6ffad, 0x7dc6ffad, 0x7ebd2149, 0x8c08d153, 0x90b5a6d3,
|
||||
0x986fd462, 0xae1c82aa, 0xbeffdc4a, 0xc0a1764b, 0xc0c0b1d3, 0xdff8c768, 0xe0e6a6d3,
|
||||
0xe23b0f34, 0xe35f372f, 0xe9ff4748, 0xeed8b943,
|
||||
// -- seed.bitnodes.io --
|
||||
0x4d3921f, 0xf480548, 0x1356b1d1, 0x1d25ddd8, 0x1d556056, 0x233d2567, 0x3058a2b2,
|
||||
0x3ee58c9e, 0x45ea0747, 0x4abd2088, 0x4d0d97d8, 0x5246b2b3, 0x5a0ae25b, 0x5a0ea9d9,
|
||||
0x5a55f450, 0x64610545, 0x6ed40d3e, 0x7a48cb4a, 0x98c5b35d, 0xaeb473bc, 0xdcefff86,
|
||||
0xe170d951, 0xe76280b2, 0xfa1f645e, 0xfb96466d,
|
||||
0x4d3921f, 0xf480548, 0x1356b1d1, 0x1d25ddd8, 0x1d556056, 0x233d2567, 0x3058a2b2,
|
||||
0x3ee58c9e, 0x45ea0747, 0x4abd2088, 0x4d0d97d8, 0x5246b2b3, 0x5a0ae25b, 0x5a0ea9d9,
|
||||
0x5a55f450, 0x64610545, 0x6ed40d3e, 0x7a48cb4a, 0x98c5b35d, 0xaeb473bc, 0xdcefff86,
|
||||
0xe170d951, 0xe76280b2, 0xfa1f645e, 0xfb96466d,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,6 @@ public class TradeCurrencyMakers {
|
||||
|
||||
public static final CryptoCurrency bitcoin = make(a(CryptoCurrency));
|
||||
public static final FiatCurrency euro = make(a(FiatCurrency));
|
||||
public static final FiatCurrency usd = make(a(FiatCurrency).but(with(currencyCode,"USD")));
|
||||
public static final FiatCurrency usd = make(a(FiatCurrency).but(with(currencyCode, "USD")));
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class VolumeMaker {
|
||||
public static final Property<Volume, String> volumeString = new Property<>();
|
||||
|
||||
public static final Instantiator<Volume> FiatVolume = lookup ->
|
||||
new Volume(Fiat.parseFiat(lookup.valueOf(currencyCode, "USD"), lookup.valueOf(volumeString,"100")));
|
||||
new Volume(Fiat.parseFiat(lookup.valueOf(currencyCode, "USD"), lookup.valueOf(volumeString, "100")));
|
||||
|
||||
public static final Instantiator<Volume> AltcoinVolume = lookup ->
|
||||
new Volume(Altcoin.parseAltcoin(lookup.valueOf(currencyCode, "LTC"), lookup.valueOf(volumeString, "100")));
|
||||
|
@ -35,44 +35,44 @@ public class OfferMaker {
|
||||
public static final Property<Offer, Double> marketPriceMargin = new Property<>();
|
||||
|
||||
public static final Instantiator<Offer> Offer = lookup -> new Offer(
|
||||
new OfferPayload("",
|
||||
0L,
|
||||
null,
|
||||
null,
|
||||
lookup.valueOf(direction, OfferPayload.Direction.BUY),
|
||||
lookup.valueOf(price, 100000L),
|
||||
lookup.valueOf(marketPriceMargin, 0.0),
|
||||
lookup.valueOf(useMarketBasedPrice, false),
|
||||
lookup.valueOf(amount, 100000L),
|
||||
lookup.valueOf(minAmount, 100000L),
|
||||
lookup.valueOf(baseCurrencyCode, "BTC"),
|
||||
lookup.valueOf(counterCurrencyCode, "USD"),
|
||||
null,
|
||||
null,
|
||||
"SEPA",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"",
|
||||
0L,
|
||||
0L,
|
||||
0L,
|
||||
false,
|
||||
0L,
|
||||
0L,
|
||||
0L,
|
||||
0L,
|
||||
false,
|
||||
false,
|
||||
0L,
|
||||
0L,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
0));
|
||||
new OfferPayload("",
|
||||
0L,
|
||||
null,
|
||||
null,
|
||||
lookup.valueOf(direction, OfferPayload.Direction.BUY),
|
||||
lookup.valueOf(price, 100000L),
|
||||
lookup.valueOf(marketPriceMargin, 0.0),
|
||||
lookup.valueOf(useMarketBasedPrice, false),
|
||||
lookup.valueOf(amount, 100000L),
|
||||
lookup.valueOf(minAmount, 100000L),
|
||||
lookup.valueOf(baseCurrencyCode, "BTC"),
|
||||
lookup.valueOf(counterCurrencyCode, "USD"),
|
||||
null,
|
||||
null,
|
||||
"SEPA",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"",
|
||||
0L,
|
||||
0L,
|
||||
0L,
|
||||
false,
|
||||
0L,
|
||||
0L,
|
||||
0L,
|
||||
0L,
|
||||
false,
|
||||
false,
|
||||
0L,
|
||||
0L,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
0));
|
||||
|
||||
public static final Maker<Offer> btcUsdOffer = a(Offer);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class DisplayedTransactionsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateWhenRepositoryIsEmpty(){
|
||||
public void testUpdateWhenRepositoryIsEmpty() {
|
||||
BtcWalletService walletService = mock(BtcWalletService.class);
|
||||
when(walletService.getTransactions(false))
|
||||
.thenReturn(Collections.singleton(mock(Transaction.class)));
|
||||
|
@ -66,7 +66,7 @@ public class OfferBookChartViewModelTest {
|
||||
|
||||
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
|
||||
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter());
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter());
|
||||
assertEquals(0, model.maxPlacesForBuyPrice.intValue());
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public class OfferBookChartViewModelTest {
|
||||
when(priceFeedService.updateCounterProperty()).thenReturn(new SimpleIntegerProperty());
|
||||
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
|
||||
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService,null, new BSFormatter());
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(0, model.maxPlacesForBuyPrice.intValue());
|
||||
}
|
||||
@ -102,9 +102,9 @@ public class OfferBookChartViewModelTest {
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(7, model.maxPlacesForBuyPrice.intValue());
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price,94016475L))));
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price, 94016475L))));
|
||||
assertEquals(9, model.maxPlacesForBuyPrice.intValue());
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price,101016475L))));
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price, 101016475L))));
|
||||
assertEquals(10, model.maxPlacesForBuyPrice.intValue());
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public class OfferBookChartViewModelTest {
|
||||
|
||||
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
|
||||
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter());
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter());
|
||||
assertEquals(0, model.maxPlacesForBuyVolume.intValue());
|
||||
}
|
||||
|
||||
@ -131,9 +131,9 @@ public class OfferBookChartViewModelTest {
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(4, model.maxPlacesForBuyVolume.intValue()); //0.01
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount,100000000L))));
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount, 100000000L))));
|
||||
assertEquals(5, model.maxPlacesForBuyVolume.intValue()); //10.00
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount,22128600000L))));
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount, 22128600000L))));
|
||||
assertEquals(7, model.maxPlacesForBuyVolume.intValue()); //2212.86
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ public class OfferBookChartViewModelTest {
|
||||
|
||||
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
|
||||
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter());
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter());
|
||||
assertEquals(0, model.maxPlacesForSellPrice.intValue());
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ public class OfferBookChartViewModelTest {
|
||||
when(priceFeedService.updateCounterProperty()).thenReturn(new SimpleIntegerProperty());
|
||||
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
|
||||
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService,null, new BSFormatter());
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(0, model.maxPlacesForSellPrice.intValue());
|
||||
}
|
||||
@ -180,9 +180,9 @@ public class OfferBookChartViewModelTest {
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(7, model.maxPlacesForSellPrice.intValue());
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price,94016475L))));
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 94016475L))));
|
||||
assertEquals(9, model.maxPlacesForSellPrice.intValue());
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price,101016475L))));
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 101016475L))));
|
||||
assertEquals(10, model.maxPlacesForSellPrice.intValue());
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ public class OfferBookChartViewModelTest {
|
||||
|
||||
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
|
||||
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter());
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter());
|
||||
assertEquals(0, model.maxPlacesForSellVolume.intValue());
|
||||
}
|
||||
|
||||
@ -209,9 +209,9 @@ public class OfferBookChartViewModelTest {
|
||||
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(4, model.maxPlacesForSellVolume.intValue()); //0.01
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount,100000000L))));
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount, 100000000L))));
|
||||
assertEquals(5, model.maxPlacesForSellVolume.intValue()); //10.00
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount,22128600000L))));
|
||||
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount, 22128600000L))));
|
||||
assertEquals(7, model.maxPlacesForSellVolume.intValue()); //2212.86
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class SpreadViewModelTest {
|
||||
final SpreadViewModel model = new SpreadViewModel(offerBook, null, new BSFormatter());
|
||||
model.activate();
|
||||
assertEquals(6, model.maxPlacesForAmount.intValue()); // 0.001
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount,1403000000L))));
|
||||
offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount, 1403000000L))));
|
||||
assertEquals(7, model.maxPlacesForAmount.intValue()); //14.0300
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest({BtcWalletService .class, AddressEntry.class, PriceFeedService.class, User.class,
|
||||
@PrepareForTest({BtcWalletService.class, AddressEntry.class, PriceFeedService.class, User.class,
|
||||
FeeService.class, CreateOfferDataModel.class, PaymentAccount.class, BsqWalletService.class,
|
||||
SecurityDepositValidator.class})
|
||||
public class CreateOfferViewModelTest {
|
||||
@ -100,7 +100,7 @@ public class CreateOfferViewModelTest {
|
||||
when(user.getPaymentAccountsAsObservable()).thenReturn(FXCollections.observableSet());
|
||||
when(securityDepositValidator.validate(any())).thenReturn(new InputValidator.ValidationResult(false));
|
||||
|
||||
CreateOfferDataModel dataModel = new CreateOfferDataModel(null, btcWalletService, bsqWalletService, empty, user, null,null, priceFeedService,null, null, null, feeService, bsFormatter);
|
||||
CreateOfferDataModel dataModel = new CreateOfferDataModel(null, btcWalletService, bsqWalletService, empty, user, null, null, priceFeedService, null, null, null, feeService, bsFormatter);
|
||||
dataModel.initWithData(OfferPayload.Direction.BUY, new CryptoCurrency("BTC", "bitcoin"));
|
||||
dataModel.activate();
|
||||
|
||||
|
@ -275,7 +275,7 @@ public class OfferBookViewModelTest {
|
||||
offerBookListItems.addAll(make(btcItemWithRange.but(with(amount, 2000000000L))));
|
||||
assertEquals(16, model.maxPlacesForAmount.intValue());
|
||||
offerBookListItems.addAll(make(btcItemWithRange.but(with(minAmount, 30000000000L),
|
||||
with(amount,30000000000L))));
|
||||
with(amount, 30000000000L))));
|
||||
assertEquals(19, model.maxPlacesForAmount.intValue());
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ public class OfferBookViewModelTest {
|
||||
offerBookListItems.addAll(make(btcItemWithRange.but(with(amount, 2000000000L))));
|
||||
assertEquals(17, model.maxPlacesForVolume.intValue());
|
||||
offerBookListItems.addAll(make(btcItemWithRange.but(with(minAmount, 30000000000L),
|
||||
with(amount,30000000000L))));
|
||||
with(amount, 30000000000L))));
|
||||
assertEquals(25, model.maxPlacesForVolume.intValue());
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ public class CurrencyListItemMakers {
|
||||
public static final Property<CurrencyListItem, Integer> numberOfTrades = new Property<>();
|
||||
|
||||
public static final Instantiator<CurrencyListItem> CurrencyListItem = lookup ->
|
||||
new CurrencyListItem(lookup.valueOf(tradeCurrency, bitcoin), lookup.valueOf(numberOfTrades, 0));
|
||||
new CurrencyListItem(lookup.valueOf(tradeCurrency, bitcoin), lookup.valueOf(numberOfTrades, 0));
|
||||
|
||||
public static final Maker<CurrencyListItem> bitcoinItem = a(CurrencyListItem);
|
||||
public static final Maker<CurrencyListItem> euroItem = a(CurrencyListItem, with(tradeCurrency, euro));
|
||||
|
@ -72,7 +72,7 @@ public class GUIUtilTest {
|
||||
Res.get("shared.multipleOffers"),
|
||||
empty);
|
||||
|
||||
assertEquals("✦ BTC (BTC) - 10 offers", currencyListItemConverter.toString(make(bitcoinItem.but(with(numberOfTrades,10)))));
|
||||
assertEquals("✦ BTC (BTC) - 10 offers", currencyListItemConverter.toString(make(bitcoinItem.but(with(numberOfTrades, 10)))));
|
||||
assertEquals("★ Euro (EUR) - 0 offers", currencyListItemConverter.toString(make(euroItem)));
|
||||
assertEquals("★ Euro (EUR) - 1 offer", currencyListItemConverter.toString(make(euroItem.but(with(numberOfTrades, 1)))));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user