Skip to content
tests.rs 74.5 KiB
Newer Older
#[test]
fn phragmen_large_scale_test_2() {
	with_externalities(&mut ExtBuilder::default()
		.nominate(false)
		.minimum_validator_count(1)
		.validator_count(2)
		.build(),
	|| {
		let _ = Staking::chill(Origin::signed(10));
		let _ = Staking::chill(Origin::signed(20));
		let nom_budget: u64 = 1_000_000_000_000_000_000;
		let c_budget: u64 = 4_000_000;

		bond_validator(2, c_budget as u64);
		bond_validator(4, c_budget as u64);

		bond_nominator(50, nom_budget, vec![3, 5]);

		System::set_block_number(1);
		Session::check_rotate_session(System::block_number());

		// Each exposure => total == own + sum(others)
		check_exposure_all();

		assert_total_expo(3, nom_budget / 2 + c_budget);
		assert_total_expo(5, nom_budget / 2 + c_budget);