Fix #196 forbid empty linked account
Closes #196 (closed)
I added a test for this one because it addresses the same question that arose and was answered in !213 (merged), but there is no bug:
- Member accounts cannot have a zero balance, so
transfer_all
will not kill them. - Non-member accounts can have a zero balance, so they will be reaped. During reaping, the
AccountData
will be reset to default, unlinking the identity.
Merge request reports
Activity
changed milestone to %runtime-802
assigned to @bgallois
added RN-runtime label
requested review from @HugoTrentesaux
Non-member accounts can have a zero balance, so they will be reaped. During reaping, the
AccountData
will be reset to default, unlinking the identity.Sure but what about the refund? We should add a test that the account balance is still zero one block after, when refunds are handled. That's the hole in my quota implementation ><
- Resolved by Benjamin Gallois
I added a check but I'm stupid: this behavior happens at the extrinsic level, not the call level. The test to add would be more like the one from
xt_tests.rs
. After checking my implementation, we should even be able to add:System::assert_has_event(RuntimeEvent::Quota(pallet_quota::Event::RefundFailed( AccountKeyring::Alice.to_account_id(), )));
to check that the account could not be re-created by the refund. I think it should be ok because I used
resolve_into_existing
instead ofresolve_into_creating
. But nothing's worth a test ^^
removed RN-runtime label
added RN-silent label
added 6 commits
-
07483a33...d7cefb59 - 2 commits from branch
master
- 54ed0a6b - add test empty linked account
- e4a3b364 - complete the test with refund check
- d0627122 - Revert "complete the test with refund check"
- a1307555 - test refund behavior on reaped account
Toggle commit list-
07483a33...d7cefb59 - 2 commits from branch
added C-integrationtests label
requested review from @bgallois and removed review request for @HugoTrentesaux