[bisq-network/bisq] Add new 'getoffer offer-id' api method (#4608)

chimp1984 notifications at github.com
Thu Oct 15 00:27:20 UTC 2020


@chimp1984 approved this pull request.

utACK

> @@ -67,6 +68,16 @@ public CoreOffersService(CreateOfferService createOfferService,
         this.user = user;
     }
 
+    Offer getOffer(String id) {
+        List<Offer> offers = offerBookService.getOffers().stream()
+                .filter(o -> o.getId().equals(id))
+                .collect(Collectors.toList());

As we expect only one I would use a findAny and create an optional instead of a list.

> @@ -67,6 +68,16 @@ public CoreOffersService(CreateOfferService createOfferService,
         this.user = user;
     }
 
+    Offer getOffer(String id) {
+        List<Offer> offers = offerBookService.getOffers().stream()
+                .filter(o -> o.getId().equals(id))
+                .collect(Collectors.toList());

Ah see you changed that in 8394bd1f6401a0b6f6843bd3b31e3c3b391d7f3c ;-)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4608#pullrequestreview-508857895
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201014/3053cc0c/attachment.html>


More information about the bisq-github mailing list