Fix staking (#3284)

* 6 second blocks.

* Version bump

* Add test for slashable_balance()
This commit is contained in:
Gavin Wood
2019-08-01 16:01:22 +02:00
committed by GitHub
parent 17b9ef19c1
commit ae6c2f7f8c
4 changed files with 18 additions and 5 deletions
+13
View File
@@ -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);
})
}