-
Notifications
You must be signed in to change notification settings - Fork 27
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
multi: Bug fixes and code improvements #696
base: master
Are you sure you want to change the base?
multi: Bug fixes and code improvements #696
Conversation
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
…error Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
- Fix asset selector dropdown - Fix asset amount input - Fix order schedular modal and balance to maintain field - Fix order settings modal - Handle error from failed order schedules Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
619a125
to
e964790
Compare
log.Errorf("unable to get market(%s) rate from %s.", market, source) | ||
log.Infof("Proceeding without checking market rate deviation...") | ||
} else { | ||
exchangeServerRate := res.ExchangeRate // estimated receivable value for libwallet.DefaultRateRequestAmount (1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this using res.ExchangeRate
instead of res.EstimatedAmount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current calculation checks for market price deviation using the rate. before now the estimated amount was used which was incorrectly used and also the estimate might change based on some factors like the final invoiced amount.
orderInfo, err := pg.getOrderInfo(pg.orderInfo.UUID) | ||
if err != nil { | ||
log.Error(err) | ||
pg.notifyError(err) | ||
} else { | ||
pg.orderInfo = orderInfo | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i try to avoid if else statements when possible to enhance readability
orderInfo, err := pg.getOrderInfo(pg.orderInfo.UUID)
if err != nil {
log.Error(err)
pg.notifyError(err)
return
}
pg.orderInfo = orderInfo
log.Error("source wallet balance after the exchange would be less than the set balance to maintain") | ||
return errors.E(op, "source wallet balance after the exchange would be less than the set balance to maintain") // stop scheduling if the source wallet balance after the exchange would be less than the set balance to maintain | ||
if invoicedAmount == walletBalance { | ||
errMsg := "Specify a little balance to maintain to cover for transaction fees... e.g 0.001 for DCR to BTC or LTC swaps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this band aid can work for now, but we would need to improve the logic to automatically do the necessary calculation from our end, similar to what happens when a user clicks "max" on the send page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to what happens when a user clicks "max" on the send page
Same thought, but not sure if the max send has been implemented yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, not yet implemented
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
7e2dc3f
to
27aa6c4
Compare
the ID isn't shown |
i think the message in the modal is misleading, because no indication the scheduler completed successfully |
This PR resolves a handful of bugs, code improvements on the CEX page, and minor dex improvements.
assets/dcr: fix panic when sync is not active: This issue has been recurring but the fix has been included in this PR.
libwallet: rework instantswap feature
exchange: fix order detail page panic when fetching order returns an error
multi: Fix CEX page
- Fix asset selector dropdown
- Fix asset amount input
- Fix order schedular modal and balance to maintain field
- Fix order settings modal
- Handle error from failed order schedules
fix contentious lock issue causing hang during dcr sync
use midGap as default order rate for limit orders and minor code improvements