-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat(AmountToSend): refactor to use exact amounts for transactions #12169
Conversation
Jenkins BuildsClick to see older builds (42)
|
39cbe4d
to
451f439
Compare
451f439
to
c692a58
Compare
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.
c692a58
to
57eecb4
Compare
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.
LGTM
Minus the objection/question from @alexjba
57eecb4
to
e32a372
Compare
Thanks @Khushboo-dev-cpp! Had no idea we can have valid negative fees. |
5ceb2ed
to
0448918
Compare
isBridgeTx: d.isBridgeTx | ||
interactive: popup.interactive | ||
selectedSymbol: d.selectedSymbol | ||
maxInputBalance: d.maxInputBalance | ||
currentCurrency: popup.currencyStore.currentCurrency | ||
|
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.
will the multiplier by default be 1 or 0 ?
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.
multiplierIndex
default value should be 0 bc it means 10^0, effectively multiplier is 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.
Awesome work @micieslak ! Looks good to me :)
@@ -261,7 +261,7 @@ QtObject: | |||
) = | |||
try: | |||
var paths: seq[TransactionBridgeDto] = @[] | |||
let amountToSend = conversion.eth2Wei(parseFloat(value), 18) | |||
let amountToSend = value.parse(Uint256) |
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.
does that require change in status go?
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.
For this change - no. In general taking raw amount from go is needed to e.g. reliably compare values
0448918
to
4180b56
Compare
What does the PR do
Fixes inaccuracies caused by passing amount to be transferred as a float from UI to backend.
transfer
methodtransaction/service.nim
takes amount in base units (integer) instead as floats (base units divided bydecimals
parameter, 18 for eth). Thanks to thateth2Wei
(leading to problems described in [EPIC] Exchange amounts between UI and backend using strings with base units instead of js numbers #11376) is not used internally. UI is responsible to provide exact amount to transfer.rawBalance
exposed to UI as decimal integer string (token model)AmountToSend
refactored/simplifiedLocaleUtils::currencyAmountToLocaleString
Closes: #12168
Affected areas
SendModal
,AmountToSend
, backend: transaction serviceScreenshot of functionality (including design for comparison)
Kazam_screencast_00031.webm
Before the change, the same transaction for
0.07
would end up with following transaction: