Open gui1117 opened 3 years ago
It seems to me that fn withdraw
make use of ensure_can_withdraw
without further checks on providers requirement, thus it is also wrong.
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.
still relevant to me, but people can use the new token traits which doesn't have this error
the method
ensure_can_withdraw
in the traitCurreny
says:In the pallet balance implementation, if an account has a consumer and withdraw all its balance, the withdraw will fail due to provider being required. However the check
ensure_can_withdraw
will succeed.Fixing it is not straightforward because the method
ensure_can_withdraw
has in input how much is the new_balance but not how much is the new reserved_balance. If we consider that the reserved balance is the one currently hold, then a fix can be: