mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Invulnerabiity from slashing for certain validators (#1355)
* Invulnerabiity from slashing * Update srml/staking/src/lib.rs Co-Authored-By: gavofyork <github@gavwood.com>
This commit is contained in:
@@ -35,6 +35,22 @@ fn note_null_offline_should_work() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn invulnerability_should_work() {
|
||||
with_externalities(&mut new_test_ext(0, 3, 3, 0, true, 10), || {
|
||||
Staking::set_invulnerables(vec![10]);
|
||||
Balances::set_free_balance(&10, 70);
|
||||
assert_eq!(Staking::offline_slash_grace(), 0);
|
||||
assert_eq!(Staking::slash_count(&10), 0);
|
||||
assert_eq!(Balances::free_balance(&10), 70);
|
||||
System::set_extrinsic_index(1);
|
||||
Staking::on_offline_validator(10, 1);
|
||||
assert_eq!(Staking::slash_count(&10), 0);
|
||||
assert_eq!(Balances::free_balance(&10), 70);
|
||||
assert!(Staking::forcing_new_era().is_none());
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn note_offline_should_work() {
|
||||
with_externalities(&mut new_test_ext(0, 3, 3, 0, true, 10), || {
|
||||
|
||||
Reference in New Issue
Block a user