Adjust GrpcOffersService to new .proto *Pct field names

This commit is contained in:
ghubstan 2022-02-20 15:18:37 -03:00
parent 5cc928a7e5
commit 8408c093e0
No known key found for this signature in database
GPG Key ID: E35592D6800A861E

View File

@ -125,9 +125,8 @@ class GrpcOffersService extends OffersImplBase {
try {
String offerId = req.getId();
Optional<OpenOffer> myOpenOffer = coreApi.findMyOpenOffer(offerId);
OfferInfo offerInfo = myOpenOffer.isPresent()
? toMyOfferInfo(myOpenOffer.get())
: toOfferInfo(coreApi.getOffer(offerId));
OfferInfo offerInfo = myOpenOffer.map(OfferInfo::toMyOfferInfo)
.orElseGet(() -> toOfferInfo(coreApi.getOffer(offerId)));
var reply = GetOfferReply.newBuilder()
.setOffer(offerInfo.toProtoMessage())
.build();
@ -278,10 +277,10 @@ class GrpcOffersService extends OffersImplBase {
req.getDirection(),
req.getPrice(),
req.getUseMarketBasedPrice(),
req.getMarketPriceMargin(),
req.getMarketPriceMarginPct(),
req.getAmount(),
req.getMinAmount(),
req.getBuyerSecurityDeposit(),
req.getBuyerSecurityDepositPct(),
req.getTriggerPrice(),
req.getPaymentAccountId(),
req.getMakerFeeCurrencyCode(),
@ -307,7 +306,7 @@ class GrpcOffersService extends OffersImplBase {
coreApi.editOffer(req.getId(),
req.getPrice(),
req.getUseMarketBasedPrice(),
req.getMarketPriceMargin(),
req.getMarketPriceMarginPct(),
req.getTriggerPrice(),
req.getEnable(),
req.getEditType());