<p></p>
<p><b>@dmos62</b> requested changes on this pull request.</p>
<hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/4329#discussion_r444413435">core/src/main/java/bisq/core/grpc/CoreOffersService.java</a>:</p>
<pre style='color:#555'>> +
+ @Inject
+ public CoreOffersService(CreateOfferService createOfferService,
+ OfferBookService offerBookService,
+ OpenOfferManager openOfferManager,
+ User user) {
+ this.createOfferService = createOfferService;
+ this.offerBookService = offerBookService;
+ this.openOfferManager = openOfferManager;
+ this.user = user;
+ }
+
+ public List<Offer> getOffers(String direction, String fiatCurrencyCode) {
+ List<Offer> offers = offerBookService.getOffers().stream()
+ .filter(o -> !o.getDirection().name().equalsIgnoreCase(direction)
+ && o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode))
</pre>
<p>Would like to see these predicates moved into descriptive intermediate variables for the sake of readability.</p>
<pre><code>o -> {
var offerOfWantedDirection = !o.getDirection().name().equalsIgnoreCase(direction);
var offerInWantedCurrency = o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode);
return offerOfWantedDirection && offerInWantedCurrency;
}
</code></pre>
<hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/4329#discussion_r444417732">core/src/main/java/bisq/core/grpc/CoreOffersService.java</a>:</p>
<pre style='color:#555'>> + private final User user;
+
+ @Inject
+ public CoreOffersService(CreateOfferService createOfferService,
+ OfferBookService offerBookService,
+ OpenOfferManager openOfferManager,
+ User user) {
+ this.createOfferService = createOfferService;
+ this.offerBookService = offerBookService;
+ this.openOfferManager = openOfferManager;
+ this.user = user;
+ }
+
+ public List<Offer> getOffers(String direction, String fiatCurrencyCode) {
+ List<Offer> offers = offerBookService.getOffers().stream()
+ .filter(o -> !o.getDirection().name().equalsIgnoreCase(direction)
</pre>
<p>There is an inconsistency here. If we call with <code>direction = sell</code>, this will return offers with <code>direction = buy</code>. Not yet sure how to fix it.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4329#pullrequestreview-436033502">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVFVGKM6R6GPSBRR73RYDXOHANCNFSM4OE4ZSBA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNS5RFMBXHU6JFXP453RYDXOHA5CNFSM4OE4ZSBKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODH6VPXQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4329#pullrequestreview-436033502",
"url": "https://github.com/bisq-network/bisq/pull/4329#pullrequestreview-436033502",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>