Closed gianfra-t closed 1 month ago
@gianfra-t is this ready for review? You didn't add reviewers.
Yes @ebma it is, but tests are failing (I was waiting for them). I will check if it is related.
I will ran format afterwards since it will as always complicate the review of actual changes.
I merged this even if the CI showed a failure, because locally when running the last clippy
commands they all work. It may have been a one time thing.
Is the failing CI due to clippy? Isn't it the Test job that fails with the following error?
Oct 14 13:51:18.446 ERROR parachain_staking::pallet: 💥 keeping old session because of empty collator set!
But that has been a very common log we see almost always we start the chain in tests. I doubt it will make the CI fail.
It almost seems like it didn't run the last 3 jobs.
Ohhh I checked the logs of the CI again and I see:
System.IO.IOException: No space left on device : '/home/runner/runners/2.320.0/_diag/Worker_20241014-124125-utc.log
So that's it.
Closes #483
Uses the
reducible_balance
fn from theInspect
trait. This is the truly liquid balance see here oforml_tokens
and here forpallet_balances
. Here frozen has a different meaning but the meaning of liquid is the same judging by how both use it in theirtransfer_all
function.There is no need to substract from
reserved
since these free and reserved are already mutually exclusive (see the reserve extrinsic).Why not use MultiCurrency
Sadly, this trait does not implement the notion of a reducible balance nor of a frozen balance. It does implement this notion in
ensure_can_withdraw
but this won't actually tell us the amount, so theInspect
trait seems to be the only choice (that I could find). But this means we need to match between the native and token variants, which is not very ergonomic. Also, the return is encoded to avoid mismatches ofBalance
type.