-
Notifications
You must be signed in to change notification settings - Fork 22
update mocks to have >1 ED and update breaking tests #2619
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
base: main
Are you sure you want to change the base?
update mocks to have >1 ED and update breaking tests #2619
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
pallet_balances::GenesisConfig::<Test> { | ||
balances: vec![ | ||
(50, 5), | ||
(50, 15), |
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.
Note: balances pallet will not allow accounts to be created with less than ED, now 10 is the minimum.
PalletBalances::can_withdraw(&CHARLIE, 30), | ||
WithdrawConsequence::ReducedToZero(0) | ||
); | ||
assert_eq!(PalletBalances::can_withdraw(&CHARLIE, 29), WithdrawConsequence::Success); |
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.
Note: can_withdraw maxes out at 20 because of 10 ED (30 - ED(10) = 20). The ReducedToZero(0)
error validates that the entire balance is available, else the error returned would be WithdrawConsequence:Frozen
as in the above cases.
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.
🚢 it!
Goal
The goal of this PR is to update mocks to have >1 ED so that we can test over and under cases in the future.
Closes #1852
Discussion
Checklist