@@ -37,14 +37,18 @@ fn test_setup_works() {
3737 ) ;
3838 assert_eq ! (
3939 RewardPools :: <Runtime >:: get( last_pool) . unwrap( ) ,
40- RewardPool :: <Runtime > { balance: 0 , points: 0 . into( ) , total_earnings: 0 }
40+ RewardPool :: <Runtime > {
41+ balance: Balances :: minimum_balance( ) ,
42+ points: 0 . into( ) ,
43+ total_earnings: Balances :: minimum_balance( )
44+ }
4145 ) ;
4246 assert_eq ! (
4347 Delegators :: <Runtime >:: get( 10 ) . unwrap( ) ,
4448 Delegator :: <Runtime > {
4549 pool_id: last_pool,
4650 points: 10 ,
47- reward_pool_total_earnings: 0 ,
51+ reward_pool_total_earnings: Balances :: minimum_balance ( ) ,
4852 unbonding_era: None
4953 }
5054 )
@@ -374,7 +378,7 @@ mod join {
374378 Delegator :: <Runtime > {
375379 pool_id: 1 ,
376380 points: 2 ,
377- reward_pool_total_earnings: 0 ,
381+ reward_pool_total_earnings: Balances :: minimum_balance ( ) ,
378382 unbonding_era: None
379383 }
380384 ) ;
@@ -397,7 +401,7 @@ mod join {
397401 Delegator :: <Runtime > {
398402 pool_id: 1 ,
399403 points: 24 ,
400- reward_pool_total_earnings: 0 ,
404+ reward_pool_total_earnings: Balances :: minimum_balance ( ) ,
401405 unbonding_era: None
402406 }
403407 ) ;
@@ -1742,6 +1746,7 @@ mod withdraw_unbonded_other {
17421746 assert_ok ! ( Pools :: unbond_other( Origin :: signed( 550 ) , 550 ) ) ;
17431747 unsafe_set_state ( 1 , PoolState :: Destroying ) . unwrap ( ) ;
17441748 assert_ok ! ( Pools :: unbond_other( Origin :: signed( 10 ) , 10 ) ) ;
1749+ assert_eq ! ( Balances :: free_balance( & 10 ) , 10 ) ;
17451750
17461751 SubPoolsStorage :: < Runtime > :: insert (
17471752 1 ,
@@ -2207,6 +2212,15 @@ mod create {
22072212 MaxPools :: < Runtime > :: put ( 3 ) ;
22082213 MaxDelegators :: < Runtime > :: put ( 1 ) ;
22092214
2215+ // Then
2216+ assert_noop ! (
2217+ Pools :: create( Origin :: signed( 11 ) , 20 , 11 , 11 , 11 ) ,
2218+ Error :: <Runtime >:: InsufficientFundsToCreate
2219+ ) ;
2220+
2221+ // Given
2222+ Balances :: make_free_balance_be ( & 11 , Balances :: minimum_balance ( ) + 20 ) ;
2223+
22102224 // Then
22112225 assert_noop ! (
22122226 Pools :: create( Origin :: signed( 11 ) , 20 , 11 , 11 , 11 ) ,
0 commit comments