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

Fix fungibles unbalanced #823

Merged
merged 2 commits into from
Nov 2, 2022
Merged

Fix fungibles unbalanced #823

merged 2 commits into from
Nov 2, 2022

Conversation

zjb0807
Copy link
Contributor

@zjb0807 zjb0807 commented Oct 27, 2022

@codecov-commenter
Copy link

Codecov Report

Merging #823 (3c9f1d1) into master (2c48b62) will increase coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #823      +/-   ##
==========================================
+ Coverage   78.24%   78.37%   +0.13%     
==========================================
  Files         102      102              
  Lines       10129    10191      +62     
==========================================
+ Hits         7925     7987      +62     
  Misses       2204     2204              
Impacted Files Coverage Δ
tokens/src/tests_events.rs 100.00% <ø> (ø)
tokens/src/lib.rs 84.18% <100.00%> (+0.03%) ⬆️
tokens/src/tests_fungibles.rs 98.94% <100.00%> (+0.48%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@PoisonPhang
Copy link

See my comments on the related changes in the Substrate PR

Comment on lines +125 to +128
assert_eq!(
<Tokens as fungibles::Unbalanced<_>>::decrease_balance_at_most(DOT, &ALICE, 60),
0
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should succeed and return 50

@zjb0807 zjb0807 mentioned this pull request Oct 30, 2022
@xlc xlc merged commit 49c4e62 into master Nov 2, 2022
@xlc xlc deleted the test-fungibles-unbalanced branch November 2, 2022 00:30
xlc pushed a commit that referenced this pull request Nov 7, 2022
* Add fungibles::Unbalanced tests

* fix set_balance
xlc added a commit that referenced this pull request Nov 7, 2022
* Fix fungibles unbalanced (#823)

* Add fungibles::Unbalanced tests

* fix set_balance

* run CI for release branch

Co-authored-by: zjb0807 <zjb0807@qq.com>
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.

Incorrect calculations when used with fungibles::Unbalanced::decrease_balance()
5 participants