Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edit offer problem for payment accounts with multiple currencies #1595

Conversation

ripcurlx
Copy link
Contributor

Rename classes to prevent confusion and add fix for payment accounts with multiple currencies when editing offers

…with multiple currencies when editing offers
@ripcurlx ripcurlx requested a review from ManfredKarrer June 27, 2018 17:31
PaymentAccount lastSelectedPaymentAccount = getPreselectedPaymentAccount();
if (lastSelectedPaymentAccount != null &&
user.getPaymentAccounts() != null &&
user.getPaymentAccounts().contains(lastSelectedPaymentAccount)) {
user.getPaymentAccounts().stream().anyMatch(paymentAccount -> paymentAccount.getId() == lastSelectedPaymentAccount.getId())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be:
paymentAccount.getId().equals(lastSelectedPaymentAccount.getId())))

final PaymentAccount tmpPaymentAccount = user.getPaymentAccount(openOffer.getOffer().getMakerPaymentAccountId());
final TradeCurrency selectedTradeCurrency = CurrencyUtil.getTradeCurrency(openOffer.getOffer().getCurrencyCode()).get();

this.paymentAccount = PaymentAccount.fromProto(tmpPaymentAccount.toProtoMessage(), corePersistenceProtoResolver);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add a comment why we clone

Copy link
Contributor

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@ManfredKarrer ManfredKarrer merged commit 802ec48 into bisq-network:master Jun 27, 2018
@ripcurlx ripcurlx deleted the fix-and-refactor-edit-offer-with-multiple-currency-payment-accounts branch September 5, 2018 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants