Merge branch '7-more-grpcproto-comments' into 8-remove-trdstats-service

This commit is contained in:
ghubstan 2022-02-26 17:53:04 -03:00
commit a1f059ded4
No known key found for this signature in database
GPG Key ID: E35592D6800A861E
3 changed files with 7 additions and 7 deletions

View File

@ -204,7 +204,7 @@ public class CoreApi {
Consumer<Offer> resultHandler) {
coreOffersService.createAndPlaceOffer(currencyCode,
directionAsString,
price,
useMarketBasedPrice ? "0" : price,
useMarketBasedPrice,
marketPriceMargin,
amountAsLong,

View File

@ -259,7 +259,7 @@ class CoreOffersService {
String offerId = getRandomOfferId();
OfferDirection direction = OfferDirection.valueOf(directionAsString.toUpperCase());
Coin amount = Coin.valueOf(amountAsLong);
Coin minAmount = Coin.valueOf(minAmountAsLong);
Coin minAmount = minAmountAsLong == 0 ? amount : Coin.valueOf(minAmountAsLong);
Price price = Price.valueOf(currencyCode, priceStringToLong(priceAsString, currencyCode));
openBsqSwapOfferService.requestNewOffer(offerId,
direction,
@ -294,7 +294,7 @@ class CoreOffersService {
OfferDirection direction = OfferDirection.valueOf(directionAsString.toUpperCase());
Price price = Price.valueOf(upperCaseCurrencyCode, priceStringToLong(priceAsString, upperCaseCurrencyCode));
Coin amount = Coin.valueOf(amountAsLong);
Coin minAmount = Coin.valueOf(minAmountAsLong);
Coin minAmount = minAmountAsLong == 0 ? amount : Coin.valueOf(minAmountAsLong);
Coin useDefaultTxFee = Coin.ZERO;
// Almost ready to call createOfferService.createAndGetOffer(), but first:

View File

@ -68,7 +68,7 @@ class EditOfferValidator {
int newEnable,
EditOfferRequest.EditType editType) {
this.currentlyOpenOffer = currentlyOpenOffer;
this.newPrice = newPrice;
this.newPrice = newPrice.isBlank() ? "0" : newPrice;
// The client cannot determine what offer.isUseMarketBasedPrice should be
// when editType = ACTIVATION_STATE_ONLY. Override newIsUseMarketBasedPrice
// param for the ACTIVATION_STATE_ONLY case.
@ -78,12 +78,12 @@ class EditOfferValidator {
? currentlyOpenOffer.getOffer().isUseMarketBasedPrice()
: newIsUseMarketBasedPrice;
this.newMarketPriceMargin = newMarketPriceMargin;
this.newTriggerPrice = newTriggerPrice;
this.newTriggerPrice = newTriggerPrice.isBlank() ? "0" : newTriggerPrice;
this.newEnable = newEnable;
this.editType = editType;
this.isZeroEditedFixedPriceString = new BigDecimal(newPrice).doubleValue() == 0;
this.isZeroEditedTriggerPrice = new BigDecimal(newTriggerPrice).equals(ZERO);
this.isZeroEditedFixedPriceString = new BigDecimal(this.newPrice).doubleValue() == 0;
this.isZeroEditedTriggerPrice = new BigDecimal(this.newTriggerPrice).equals(ZERO);
}
EditOfferValidator validate() {