mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 20:57:59 +00:00
Fix staking (#3284)
* 6 second blocks. * Version bump * Add test for slashable_balance()
This commit is contained in:
@@ -2100,3 +2100,16 @@ fn reward_from_authorship_event_handler_works() {
|
||||
assert_eq!(CurrentEraRewards::get().total, 25);
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unbonded_balance_is_not_slashable() {
|
||||
with_externalities(&mut ExtBuilder::default().build(), || {
|
||||
// total amount staked is slashable.
|
||||
assert_eq!(Staking::slashable_balance_of(&11), 1000);
|
||||
|
||||
assert_ok!(Staking::unbond(Origin::signed(10), 800));
|
||||
|
||||
// only the active portion.
|
||||
assert_eq!(Staking::slashable_balance_of(&11), 200);
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user