@@ -3287,6 +3287,22 @@ fn unstake_correctly_reduces_future_contract_stake() {
3287
3287
} )
3288
3288
}
3289
3289
3290
+ #[ test]
3291
+ fn lock_correctly_considers_unlocking_amount ( ) {
3292
+ ExtBuilder :: build ( ) . execute_with ( || {
3293
+ // Lock the entire amount & immediately start the unlocking process
3294
+ let ( staker, unlock_amount) = ( 1 , 13 ) ;
3295
+ let total_balance = Balances :: total_balance ( & staker) ;
3296
+ assert_lock ( staker, total_balance) ;
3297
+ assert_unlock ( staker, unlock_amount) ;
3298
+
3299
+ assert_noop ! (
3300
+ DappStaking :: lock( RuntimeOrigin :: signed( staker) , 1 ) ,
3301
+ Error :: <Test >:: ZeroAmount
3302
+ ) ;
3303
+ } )
3304
+ }
3305
+
3290
3306
#[ test]
3291
3307
fn fix_account_scenarios_work ( ) {
3292
3308
ExtBuilder :: build ( ) . execute_with ( || {
@@ -3358,18 +3374,3 @@ fn fix_account_scenarios_work() {
3358
3374
) ;
3359
3375
} )
3360
3376
}
3361
-
3362
- fn lock_correctly_considers_unlocking_amount ( ) {
3363
- ExtBuilder :: build ( ) . execute_with ( || {
3364
- // Lock the entire amount & immediately start the unlocking process
3365
- let ( staker, unlock_amount) = ( 1 , 13 ) ;
3366
- let total_balance = Balances :: total_balance ( & staker) ;
3367
- assert_lock ( staker, total_balance) ;
3368
- assert_unlock ( staker, unlock_amount) ;
3369
-
3370
- assert_noop ! (
3371
- DappStaking :: lock( RuntimeOrigin :: signed( staker) , 1 ) ,
3372
- Error :: <Test >:: ZeroAmount
3373
- ) ;
3374
- } )
3375
- }
0 commit comments