-
Notifications
You must be signed in to change notification settings - Fork 982
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: calculate and show max fees on transaction confirmation page #20133
Conversation
Jenkins BuildsClick to see older builds (48)
|
1c9ed29
to
d71fa5f
Compare
fee-in-native-token (when-not confirm-disabled? | ||
(send-utils/calculate-full-route-gas-fee route)) | ||
fee-in-crypto-formatted (when fee-in-native-token | ||
(utils/get-standard-crypto-format | ||
native-token | ||
fee-in-native-token)) | ||
fee-in-fiat (when-not confirm-disabled? | ||
(utils/calculate-token-fiat-value | ||
{:currency fiat-currency | ||
:balance fee-in-native-token | ||
:token native-token})) | ||
fee-formatted (when fee-in-fiat | ||
(utils/get-standard-fiat-format | ||
fee-in-crypto-formatted | ||
currency-symbol | ||
fee-in-fiat)) |
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.
Moved logic to a sub
[transaction-details | ||
{:estimated-time-min estimated-time-min | ||
:max-fees fee-formatted | ||
:token-display-name token-display-name | ||
:amount amount | ||
:to-network bridge-to-network | ||
:theme theme | ||
:route route | ||
:transaction-type transaction-type}] |
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.
Designs changed, now we should display transaction details right above the slider
21b6bf3
to
653288f
Compare
🥳 |
@@ -222,12 +209,17 @@ | |||
(get-in collectible [:preview-url :uri])) | |||
transaction-type (:tx-type send-transaction-data) | |||
estimated-time-min (reduce + (map :estimated-time route)) | |||
max-fees "-" |
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.
💣
|
||
(rf/reg-sub | ||
:wallet/wallet-send-fee-fiat-formatted | ||
:<- [:wallet/wallet-send-route] | ||
:<- [:profile/currency] | ||
:<- [:profile/currency-symbol] | ||
(fn [[route currency currency-symbol] [_ token-for-fees]] | ||
(let [fee-in-native-token (send-utils/calculate-full-route-gas-fee route) | ||
fee-in-crypto-formatted (utils/get-standard-crypto-format | ||
token-for-fees | ||
fee-in-native-token) | ||
fee-in-fiat (utils/calculate-token-fiat-value | ||
{:currency currency | ||
:balance fee-in-native-token | ||
:token token-for-fees}) | ||
fee-formatted (utils/get-standard-fiat-format | ||
fee-in-crypto-formatted | ||
currency-symbol | ||
fee-in-fiat)] | ||
fee-formatted))) |
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.
👍
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 think it's better to return them as a map and include fee-in-native-token
, fee-in-crypto-formatted
, and so on.
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.
@mmilad75 We can create separate subs for each required value. For instance, if we need fee-in-native-token
, we can create a new sub :wallet/wallet-send-fee-in-native-token
. Then, we can refactor the existing sub to use this new sub as an input signal with the :<-
macro.
:padding-bottom 16}) | ||
[{:keys [loading-suggested-routes? route-loaded?]}] | ||
{:flex-direction :row | ||
:width "100%" |
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.
Would :flex 1
or :flex-grow 1
work?
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 tried :flex 1
, but for some reason the height is ignored. :width "100%"
worked fine instead
81% of end-end tests have passed
Failed tests (8)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestWalletOneDevice:
Class TestWalletMultipleDevice:
Class TestCommunityMultipleDeviceMerged:
Expected to fail tests (2)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityOneDeviceMerged:
Passed tests (42)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityOneDeviceMerged:
Class TestWalletOneDevice:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityMultipleDevicePRTwo:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestDeepLinksOneDevice:
|
b4939df
to
db8b039
Compare
d494e16
to
e523927
Compare
e523927
to
a1ae06f
Compare
a1ae06f
to
bebc7c6
Compare
88% of end-end tests have passed
Failed tests (2)Click to expandClass TestWalletMultipleDevice:
Expected to fail tests (4)Click to expandClass TestWalletOneDevice:
Class TestCommunityOneDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Passed tests (46)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityMultipleDevicePRTwo:
Class TestWalletOneDevice:
Class TestActivityMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestDeepLinksOneDevice:
Class TestGroupChatMultipleDeviceMergedNewUI:
|
Hey @briansztamfater ! Thanks for your PR. |
Signed-off-by: Brian Sztamfater <brian@status.im>
bebc7c6
to
be6fca6
Compare
fixes #18408
Summary
This PR adds fee information on transaction confirmation page. Also it updates the UI to comply with latest designs of this screen, which shows the fees, estimated time and amount at the bottom of the screen, above the slider.
Platforms
Areas that maybe impacted
Functional
Steps to test
status: ready