mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-21 14:24:06 +01:00
Merge pull request #7386 from thecockatiel/fix_misc
fix: some issues in EditOfferOptionParser
This commit is contained in:
commit
631d0f9222
2 changed files with 4 additions and 7 deletions
|
@ -123,11 +123,9 @@ public class EditOfferOptionParser extends OfferIdOptionParser implements Method
|
|||
|
||||
if (options.has(mktPriceMarginPctOpt)) {
|
||||
if (valueNotSpecified.test(mktPriceMarginPctOpt))
|
||||
throw new IllegalArgumentException("no mkt price margin specified");
|
||||
throw new IllegalArgumentException("no market price margin specified");
|
||||
|
||||
String priceMarginPctAsString = options.valueOf(mktPriceMarginPctOpt);
|
||||
if (priceMarginPctAsString.isEmpty())
|
||||
throw new IllegalArgumentException("no market price margin specified");
|
||||
|
||||
verifyStringIsValidDouble(priceMarginPctAsString);
|
||||
|
||||
|
@ -140,6 +138,7 @@ public class EditOfferOptionParser extends OfferIdOptionParser implements Method
|
|||
}
|
||||
|
||||
boolean mktPriceMarginOptAndEnableOptAreOnlyOpts = options.has(enableOpt)
|
||||
&& !options.has(fixedPriceOpt)
|
||||
&& !options.has(triggerPriceOpt);
|
||||
if (mktPriceMarginOptAndEnableOptAreOnlyOpts) {
|
||||
offerEditType = MKT_PRICE_MARGIN_AND_ACTIVATION_STATE;
|
||||
|
@ -151,9 +150,7 @@ public class EditOfferOptionParser extends OfferIdOptionParser implements Method
|
|||
if (valueNotSpecified.test(triggerPriceOpt))
|
||||
throw new IllegalArgumentException("no trigger price specified");
|
||||
|
||||
String triggerPriceAsString = options.valueOf(fixedPriceOpt);
|
||||
if (triggerPriceAsString.isEmpty())
|
||||
throw new IllegalArgumentException("trigger price not specified");
|
||||
String triggerPriceAsString = options.valueOf(triggerPriceOpt);
|
||||
|
||||
verifyStringIsValidDouble(triggerPriceAsString);
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ public class EditOfferOptionParserTest {
|
|||
};
|
||||
Throwable exception = assertThrows(RuntimeException.class, () ->
|
||||
new EditOfferOptionParser(args).parse());
|
||||
assertEquals("no mkt price margin specified",
|
||||
assertEquals("no market price margin specified",
|
||||
exception.getMessage());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue