mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Reformat and organize imports
This commit is contained in:
parent
88462c1180
commit
2d89453736
3
pom.xml
3
pom.xml
@ -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;
|
||||
}
|
||||
|
@ -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 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));
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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.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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -287,7 +287,7 @@ 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());
|
||||
|
||||
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);
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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")));
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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