From f48cd379e608f98c70bd64a83fbc2e4530b115e1 Mon Sep 17 00:00:00 2001 From: emostov <32168567+emostov@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:16:49 +0000 Subject: [PATCH] Improve error type --- frame/nomination-pools/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frame/nomination-pools/src/lib.rs b/frame/nomination-pools/src/lib.rs index 216e914cf97d5..e2030b2f1dd38 100644 --- a/frame/nomination-pools/src/lib.rs +++ b/frame/nomination-pools/src/lib.rs @@ -1004,6 +1004,8 @@ pub mod pallet { AccountBelongsToOtherPool, /// The pool has insufficient balance to bond as a nominator. InsufficientBond, + /// The caller does not have enough funds to create pool. + InsufficientFundsToCreate, /// The delegator is already unbonding. AlreadyUnbonding, /// The delegator is not unbonding and thus cannot withdraw funds. @@ -1405,7 +1407,7 @@ pub mod pallet { ensure!( T::Currency::free_balance(&who) >= amount.saturating_add(T::Currency::minimum_balance()), - Error::::MinimumBondNotMet + Error::::InsufficientFundsToCreate ); let pool_id = LastPoolId::::mutate(|id| {