-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
|
||
// divide maxValue with parsed value to get invest amount | ||
return maxValue.multiply(parsedValue).asFraction | ||
enum ErrorMsgs { |
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.
can move this into types folder
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.
mm, not sure. I would say that if this is only local to this component, is better to have it closer to the place you use.
It would be different if we reuse these in different components
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.
Build didn't trigger so I could not test it in the PR.
I'll try it locally and report back
@nenadV91 I pushed directly to this branch recommended changes. sorry would normally PR but time is short. |
Working nice after the last changes. Still, there's this funny bug: With no funds, press Screen.Recording.2022-01-18.at.14.45.08.movIt disables the input and sets bar to 100% Probably missing:
|
a9be98e
to
6453e28
Compare
fixed in latest commit 3f94fb6 |
|
* Added TODO about duplicated const * Fixing percentage calculation for max values when balance < maxCost * Refactored _calculatePercentage to return already the formatted % Co-authored-by: Leandro <[email protected]>
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.
Ready to go!
Reported in #2201 , so I linked this issue to the PR |
@elena-zh This should be fixed now since the |
Just to clarify: won't we use percentage buttons on the 'Available investment used' bar? |
|
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.
Good one.
For now, just code review. i will try to claim and use it
@@ -10,6 +10,7 @@ export const INITIAL_ALLOWED_SLIPPAGE_PERCENT = new Percent('5', '1000') // 0.5% | |||
export const RADIX_DECIMAL = 10 | |||
export const RADIX_HEX = 16 | |||
|
|||
// TODO: remove, this is duplicated with `import { ONE_HUNDRED_PERCENT } from 'constants/misc'` | |||
export const ONE_HUNDRED_PERCENT = new Percent(1, 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.
good point, would be nice a follow up PR after
|
||
// divide maxValue with parsed value to get invest amount | ||
return maxValue.multiply(parsedValue).asFraction | ||
enum ErrorMsgs { |
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.
mm, not sure. I would say that if this is only local to this component, is better to have it closer to the place you use.
It would be different if we reuse these in different components
nitpic: for another PR. If we select a bigger amount than available, shouldn't we leave the investment bar to 100%? it creates a weird effect if you increase the amount Other than that, works great. We will need to now make use of this values, cause we still invest 100% even if you reduce the amount. |
The errors claiming investments in this PR are nothing introduced here, simply missing more thing to be implemented. The amount selected in the inputs is not yet passed down to the contract. The account I’m testing with has enough to cover 100% investment in GNO and ETH, but has only partial ~40% USDC. When the contract call is made, it says I’ll invest 100% USDC but I don’t have that much. No error with this PR, good to merge. |
…low-3 Claim investment flow 3
Summary