-
Notifications
You must be signed in to change notification settings - Fork 0
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
pallet-balances configuration might need adjustment because ED is 0 #12
Comments
if ED is 0 then Eiter we try to put to convince yourself add those test in #[test]
fn deposit_into_existing_for_existing_zero_account() {
// These functions all use `mutate_account` which may introduce a storage change when
// the account never existed to begin with, and shouldn't exist in the end.
ExtBuilder::default().existential_deposit(0).build_and_execute_with(|| {
let alice = 666;
let bob = 777;
assert_ok!(Balances::force_set_balance(frame_system::Origin::<Test>::Root.into(), alice, 2000));
assert_ok!(Balances::force_transfer(frame_system::Origin::<Test>::Root.into(), alice, bob, 2000));
dbg!(666, frame_system::Account::<Test>::get(alice));
dbg!(777, frame_system::Account::<Test>::get(bob));
let _ = dbg!(Balances::deposit_into_existing(
&alice,
500,
)).unwrap();
});
}
#[test]
fn repatriate_reserved_works_for_zero_account() {
// These functions all use `mutate_account` which may introduce a storage change when
// the account never existed to begin with, and shouldn't exist in the end.
ExtBuilder::default().existential_deposit(0).build_and_execute_with(|| {
let alice = 666;
let bob = 777;
assert_ok!(Balances::force_set_balance(frame_system::Origin::<Test>::Root.into(), alice, 2000));
assert_ok!(Balances::force_transfer(frame_system::Origin::<Test>::Root.into(), alice, bob, 2000));
dbg!(666, frame_system::Account::<Test>::get(alice));
dbg!(777, frame_system::Account::<Test>::get(bob));
assert_ok!(Balances::reserve(&bob, 500));
dbg!(alice, frame_system::Account::<Test>::get(alice));
dbg!(bob, frame_system::Account::<Test>::get(bob));
// Repatriate Reserve
dbg!(Balances::repatriate_reserved(
&bob,
&alice,
500,
crate::Status::Free
)).unwrap();
});
} |
I thought it could be done easier like paritytech/polkadot-sdk#3903, but does not seem like it. |
For the purposes of DropIt, we def want ED to be 0. Any non-zero value won't work for effortless distribution. |
what is the problem with having ED to be 1 unit? like 0.0000....0001 DOT The dust when going below ED would always be 0. I'm afraid some issue will arise when It is like a sword of Damocles |
there is those issues:
paritytech/substrate#10117
paritytech/polkadot-sdk#337
I proposed a fix on the configurations of the pallet: paritytech/substrate#10117 (comment)
that said I don't remember any details
Also some warning in the code:
The text was updated successfully, but these errors were encountered: