-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes dust balance handling for pallet revive #9357
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
Conversation
Corrects the condition for minting a new currency unit when transferring dust. The condition was incorrectly checking `to_info.dust.saturating_add(dust) >= plank` which could lead to unexpected minting behavior. It now correctly checks if `to_info.dust >= plank` before minting. Adds a test case to ensure the correct behavior when the receiver's dust balance is less than one plank.
transfer_dust::<T>(&mut from_info, &mut to_info, dust)?; | ||
|
||
if to_info.dust.saturating_add(dust) >= plank { | ||
if to_info.dust >= plank { |
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.
So the bug here is that we are adding it twice as it was already added in transfer_dust
?
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.
yes, exactly.
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.
Thanks for fixing this.
/cmd fmt |
Command "fmt" has failed ❌! See logs here |
You don't allow changes by maintainers. Please run |
- add prdoc - run `cargo +nightly fmt`
Review required! Latest push from author must always be reviewed |
@athei updated. |
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.
Thanks. Unfortunately, we need to approve after every change for external contributors. cc @pgherveou
59fb2e7
fix issue: paritytech/contract-issues#141 Corrects the condition for minting a new currency unit when transferring dust. The condition was incorrectly checking `to_info.dust.saturating_add(dust) >= plank` which could lead to unexpected minting behavior. It now correctly checks if `to_info.dust >= plank` before minting.
- #9112 - #9101 - #9416 - #9357 - #9441 - #9267 Those are all the changes we want to get onto the next Kusama release. The new gas mapping and EVM backend will not make it. --------- Co-authored-by: PG Herveou <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francisco Aguirre <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: sekiseki <[email protected]> Co-authored-by: Michael Müller <[email protected]>
fix issue: paritytech/contract-issues#141 Corrects the condition for minting a new currency unit when transferring dust. The condition was incorrectly checking `to_info.dust.saturating_add(dust) >= plank` which could lead to unexpected minting behavior. It now correctly checks if `to_info.dust >= plank` before minting.
fix issue: paritytech/contract-issues#141
Corrects the condition for minting a new currency unit when transferring dust. The condition was incorrectly checking
to_info.dust.saturating_add(dust) >= plank
which could lead to unexpected minting behavior. It now correctly checks ifto_info.dust >= plank
before minting.