Skip to content
tests.rs 250 KiB
Newer Older
					&initially_disabled,
				);

			assert!(disable_offender.is_none());
		});
	}

	#[test]
	fn disable_when_below_byzantine_threshold() {
		sp_io::TestExternalities::default().execute_with(|| {
			let initially_disabled = vec![1];
			pallet_session::Validators::<Test>::put(ACTIVE_SET.to_vec());

			let disable_offender =
				<UpToLimitDisablingStrategy as DisablingStrategy<Test>>::decision(
					&OFFENDER_ID,
					SLASH_ERA,
					&initially_disabled,
				);

			assert_eq!(disable_offender, Some(OFFENDER_VALIDATOR_IDX));
		});
	}
}