5

I am developing a pallet in which I need to check the balance of the account that is making the transaction. How can I check that?

1 Answer 1

2

A common way is:

ensure!(T::Currency::free_balance(&who) >= some_value, <Error<T>>::InsufficientBalance);
1
  • reducible_balance should be more accurate will deduct locked&ed if necessary
    – Ron
    Apr 13, 2022 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.