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

Incorporate network fees in Create Payment #3275

Merged
merged 3 commits into from
Apr 11, 2022

Conversation

dit7ya
Copy link
Contributor

@dit7ya dit7ya commented Mar 29, 2022

Description

This PR

  • displays the network fee in Create Payment Dialog
  • Calls the network contract with the total amount (amount to be received + fees) so that the recipient simply gets the amount typed in the form.

Screenshot 2022-03-29 at 19-11-40 Actions Colony - Notun

Resolves #3266.

@dit7ya dit7ya added the feature label Mar 29, 2022
@dit7ya dit7ya requested a review from a team March 29, 2022 13:55
@dit7ya dit7ya self-assigned this Mar 29, 2022
@dit7ya dit7ya force-pushed the feat/3266-display-payment-fees branch from e957ee9 to ae8803e Compare March 29, 2022 14:15
Copy link
Contributor

@ArmandoGraterol ArmandoGraterol left a comment

Choose a reason for hiding this comment

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

I like this change! It should definitely improve the UX

Something weird is happening tho:
FireShot Capture 557 - Pay esotericdog 9 99999 PRR - Action - Colony - wonker - localhost
FireShot Capture 558 - Actions - Colony - wonker - localhost
FireShot Capture 559 - Events - Colony - wonker - localhost

The amount shown in event and action list is different from the amount in the action page

@dit7ya
Copy link
Contributor Author

dit7ya commented Mar 31, 2022

Good point @ArmandoGraterol. Fixed that in the last commit.

One point worth noting is that now there is no easy way for the payment initiator to know exactly how much they spent on a payment including fees.

@dit7ya dit7ya requested a review from a team March 31, 2022 12:53
Copy link
Contributor

@chinins chinins left a comment

Choose a reason for hiding this comment

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

It looks ok, I just have a question about come number calculations.

Copy link
Member

@arrenv arrenv left a comment

Choose a reason for hiding this comment

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

The appearance seems off when comparing to the design. There is no colon punctuation mark in the design, the font is more consistent in weight and size, and is closer to the the input field. See following comparison.

network-fee

@dit7ya
Copy link
Contributor Author

dit7ya commented Apr 5, 2022

@arrenv Thanks for the comments.

I will change the font weight. However, IMO the colon is consistent with the Available Funds subtitle. What do you think?

About the spacing - it is the same spacing as the Available Funds subtitle (which is also not following the spec). Do you want me to change both? If yes, what do you suggest to deal with the conflict with the insufficient balance warning?
2022-04-05_15-48

@arrenv
Copy link
Member

arrenv commented Apr 5, 2022

IMO the colon is consistent with the Available Funds subtitle. What do you think?

I agree with you, good observation.

About the spacing - it is the same spacing as the Available Funds subtitle (which is also not following the spec). Do you want me to change both? If yes, what do you suggest to deal with the conflict with the insufficient balance warning?

Another good pickup. It seems there is no decided solution for this after to chatting to Karol. One idea though was to have only one visible at a time, i.e. either the error message or the sub-text be visible at any given time. Although, that would be a separate issue to this. For the purpose of this PR, what you have makes sense.

@dit7ya dit7ya force-pushed the feat/3266-display-payment-fees branch 2 times, most recently from efab502 to 15237c7 Compare April 7, 2022 07:25
@dit7ya dit7ya force-pushed the feat/3266-display-payment-fees branch from 15237c7 to 925788b Compare April 7, 2022 11:48
Copy link
Contributor

@ArmandoGraterol ArmandoGraterol left a comment

Choose a reason for hiding this comment

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

Now the amount shown in the action list seems to be after fees so good work! However, I still found something that might be confusing:
FireShot Capture 564 - Actions - Colony - wonker - localhost
FireShot Capture 565 - Actions - Colony - wonker - localhost
FireShot Capture 566 - Pay esotericdog 10 99999 PRR - Action - Colony - wonker - localhost

I paid myself 10 and 11 tokens, when I went to the action page or to the token activation popover I see that it's shown as 9.9999... and 10.999... which is a different amount than what we show in the action list.

So from this, I have questions, is the amount shown on the action page/token activation popover the real value, and the one shown in the action list is rounded up? Or is the value in the action page/token activation popover wrong?

@arrenv
Copy link
Member

arrenv commented Apr 7, 2022

@dit7ya Yeah, I am seeing the same as Armando, it seems as though it has reverted back to how it was originally. And ignoring the fee, despite showing it.

@dit7ya
Copy link
Contributor Author

dit7ya commented Apr 7, 2022

@ArmandoGraterol I will take a look at the rounding tomorrow and do the needful. @arrenv What do you mean by it has gone back to how it was? I did some tests and it seems like it is just the rounding error of 0.00001 instead of 1% decrease like before.

@arrenv
Copy link
Member

arrenv commented Apr 7, 2022

@ArmandoGraterol I will take a look at the rounding tomorrow and do the needful. @arrenv What do you mean by it has gone back to how it was? I did some tests and it seems like it is just the rounding error of 0.00001 instead of 1% decrease like before.

I think it is just to do with the rounding errors.

@dit7ya dit7ya force-pushed the feat/3266-display-payment-fees branch from 925788b to b9b156d Compare April 8, 2022 09:50
@dit7ya
Copy link
Contributor Author

dit7ya commented Apr 8, 2022

@ArmandoGraterol @arrenv Figured that out. It was happening because the contract adds an extra 1 Wei of fee after the percentage calculation. For large amounts it was getting rounded in the UI (but not actually in the wallet balance).

Changed the calculation equation and it should be good now.

2022-04-08_15-23

Copy link
Member

@arrenv arrenv left a comment

Choose a reason for hiding this comment

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

Working for me now, nice work!

Copy link
Contributor

@ArmandoGraterol ArmandoGraterol left a comment

Choose a reason for hiding this comment

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

Nice work! It's looking good in every place that I could check

Copy link
Contributor

@chinins chinins left a comment

Choose a reason for hiding this comment

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

Looking good now - nice work!

@dit7ya dit7ya merged commit a6422b7 into master Apr 11, 2022
@dit7ya dit7ya deleted the feat/3266-display-payment-fees branch April 11, 2022 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change how fees work on payments
4 participants