mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Do not change case of input params in client
This commit is for a change requested in PR 4308: https://github.com/bisq-network/bisq/pull/4308#pullrequestreview-435055483 ".toUpperCase() seems misplaced here. It would soon get repetive. Whether the underlying logic differentiates between capitalizations is a low-level implementation detail and would do better at the lowest practical level."
This commit is contained in:
parent
a48af7c052
commit
61285a7602
3 changed files with 7 additions and 7 deletions
|
@ -184,14 +184,14 @@ public class CliMain {
|
|||
if (nonOptionArgs.size() < 2)
|
||||
throw new IllegalArgumentException("no buy/sell direction specified");
|
||||
|
||||
var direction = nonOptionArgs.get(1).toUpperCase();
|
||||
if (!direction.equals("BUY") && !direction.equals("SELL"))
|
||||
var direction = nonOptionArgs.get(1);
|
||||
if (!direction.equalsIgnoreCase("BUY") && !direction.equalsIgnoreCase("SELL"))
|
||||
throw new IllegalArgumentException("no buy/sell direction specified");
|
||||
|
||||
if (nonOptionArgs.size() < 3)
|
||||
throw new IllegalArgumentException("no fiat currency specified");
|
||||
|
||||
var fiatCurrency = nonOptionArgs.get(2).toUpperCase();
|
||||
var fiatCurrency = nonOptionArgs.get(2);
|
||||
|
||||
var request = GetOffersRequest.newBuilder()
|
||||
.setDirection(direction)
|
||||
|
@ -215,7 +215,7 @@ public class CliMain {
|
|||
if (nonOptionArgs.size() < 4)
|
||||
throw new IllegalArgumentException("no fiat currency specified");
|
||||
|
||||
var fiatCurrencyCode = nonOptionArgs.get(3).toUpperCase();
|
||||
var fiatCurrencyCode = nonOptionArgs.get(3);
|
||||
|
||||
var request = CreatePaymentAccountRequest.newBuilder()
|
||||
.setAccountName(accountName)
|
||||
|
|
|
@ -60,8 +60,8 @@ public class CoreOffersService {
|
|||
|
||||
public List<Offer> getOffers(String direction, String fiatCurrencyCode) {
|
||||
List<Offer> offers = offerBookService.getOffers().stream()
|
||||
.filter(o -> !o.getDirection().name().equals(direction)
|
||||
&& o.getOfferPayload().getCounterCurrencyCode().equals(fiatCurrencyCode))
|
||||
.filter(o -> !o.getDirection().name().equalsIgnoreCase(direction)
|
||||
&& o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (direction.equals(BUY.name()))
|
||||
|
|
|
@ -58,7 +58,7 @@ public class CorePaymentAccountsService {
|
|||
paymentAccount.init();
|
||||
paymentAccount.setAccountName(accountName);
|
||||
((PerfectMoneyAccount) paymentAccount).setAccountNr(accountNumber);
|
||||
paymentAccount.setSingleTradeCurrency(new FiatCurrency(fiatCurrencyCode));
|
||||
paymentAccount.setSingleTradeCurrency(new FiatCurrency(fiatCurrencyCode.toUpperCase()));
|
||||
user.addPaymentAccount(paymentAccount);
|
||||
|
||||
// Don't do this on mainnet until thoroughly tested.
|
||||
|
|
Loading…
Add table
Reference in a new issue