Skip to content

Commit 9bcc5e8

Browse files
committedJun 24, 2024
change
1 parent 596c68f commit 9bcc5e8

File tree

1 file changed

+16
-15
lines changed
  • pallets/dapp-staking-v3/src/test

1 file changed

+16
-15
lines changed
 

‎pallets/dapp-staking-v3/src/test/tests.rs

+16-15
Original file line numberDiff line numberDiff line change
@@ -3287,6 +3287,22 @@ fn unstake_correctly_reduces_future_contract_stake() {
32873287
})
32883288
}
32893289

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+
32903306
#[test]
32913307
fn fix_account_scenarios_work() {
32923308
ExtBuilder::build().execute_with(|| {
@@ -3358,18 +3374,3 @@ fn fix_account_scenarios_work() {
33583374
);
33593375
})
33603376
}
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

Comments
 (0)