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

chore(Communities): Refactor amounts handling for displaying, minting, airdropping and burning #11862

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

micieslak
Copy link
Member

@micieslak micieslak commented Aug 10, 2023

What does the PR do

This PR refactors functionality of minting, airdrop and burn regarding handling fees. Provided earlier utilities AmountsArithmetic are used to handle amounts as big integers instead of floats. It prevents from problems described in #11376. Permissions functionality will be covered in a separate task.

Closes: #11491

Permissions part is going to be covered in a separate task: #11863

Affected areas

Multiple components for community settings, AmountsArithmetic

@status-im-auto
Copy link
Member

status-im-auto commented Aug 10, 2023

Jenkins Builds

Click to see older builds (3)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 2357f8f #1 2023-08-10 13:02:05 ~5 min tests/imports 📄log
✔️ 2357f8f #1 2023-08-10 13:02:56 ~6 min tests/nim 📄log
✔️ 2357f8f #1 2023-08-10 13:04:04 ~7 min macos/aarch64 🍎dmg
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8175bb4 #2 2023-08-10 13:12:35 ~5 min tests/imports 📄log
✔️ 8175bb4 #2 2023-08-10 13:12:48 ~5 min tests/nim 📄log
✔️ 8175bb4 #2 2023-08-10 13:15:52 ~8 min macos/aarch64 🍎dmg
✔️ 8175bb4 #2 2023-08-10 13:21:02 ~13 min macos/x86_64 🍎dmg
✔️ 8175bb4 #2 2023-08-10 13:37:28 ~30 min tests/e2e 📄log
✔️ 8175bb4 #2 2023-08-10 13:39:28 ~32 min windows/x86_64 💿exe
✔️ c1b1749 #3 2023-08-17 08:00:33 ~5 min macos/aarch64 🍎dmg
✔️ c1b1749 #3 2023-08-17 08:00:33 ~5 min tests/imports 📄log
✔️ c1b1749 #3 2023-08-17 08:00:53 ~5 min tests/nim 📄log
✔️ c1b1749 #3 2023-08-17 08:03:17 ~8 min macos/x86_64 🍎dmg
✔️ c1b1749 #3 2023-08-17 08:16:39 ~21 min windows/x86_64 💿exe
✔️ c1b1749 #3 2023-08-17 08:24:55 ~29 min tests/e2e 📄log

Copy link
Contributor

@alexandraB99 alexandraB99 left a comment

Choose a reason for hiding this comment

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

haven't tested - code looks good!

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

There are other places which imho need some fixes (like WalletAccountsModel in storybook)?

@micieslak
Copy link
Member Author

There are other places which imho need some fixes (like WalletAccountsModel in storybook)?

The functionality I've refactored doesn't use wallte model's assets, where amounts are expressed as floats. That should be changed in the next iteration when functionality using that will be altered.

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM

@glitchminer
Copy link
Contributor

Hey @micieslak , not entirely sure if this is covered by these changes but there was a discrepancy noted when viewing remaining tokens and attempting to airdrop.

  1. Create token with 999,999,999 supply and 10 decimal places

  2. Airdrop 0.000000001

  3. Remaining supply still shows 999,999,999
    image

  4. Start another airdrop - 999,999,999 is accepted without error despite the available balance being only 999999998.999999999
    image

  5. Also note that despite being configured with 10 decimal places the number that is able to be used while airdropping depends on the size of integer
    image

@micieslak
Copy link
Member Author

Hey @micieslak , not entirely sure if this is covered by these changes but there was a discrepancy noted when viewing remaining tokens and attempting to airdrop.

Thanks @glitchminer for pointing those issues. The same problem exists in the current master and they are not directly related to this PR so I created separate tasks for them:

#11917
#11918

Copy link
Contributor

@endulab endulab left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor backend public methods taking amounts as floats
6 participants