Newer
Older
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
bond_validator(prefix + 20, 797663650978304);
bond_validator(prefix + 22, 900003879248198);
bond_validator(prefix + 24, 997530000000000);
bond_validator(prefix + 26, 1000000000010000);
bond_validator(prefix + 28, 1000000000020000);
bond_validator(prefix + 30, 1000003879248198);
bond_validator(prefix + 32, 1200000000000000);
bond_validator(prefix + 34, 7997659802817256);
bond_validator(prefix + 36, 18000000000000000);
bond_validator(prefix + 38, 20000033025753738);
bond_validator(prefix + 40, 500000000000100000);
bond_validator(prefix + 42, 500000000000200000);
Balances::make_free_balance_be(&50, u64::max_value());
Balances::make_free_balance_be(&49, u64::max_value());
bond_nominator(50, 990000068998617227, vec![
prefix + 1,
prefix + 3,
prefix + 5,
prefix + 7,
prefix + 9,
prefix + 11,
prefix + 13,
prefix + 15,
prefix + 17,
prefix + 19,
prefix + 21,
prefix + 23,
prefix + 25,
prefix + 27,
prefix + 29,
prefix + 31,
prefix + 33,
prefix + 35,
prefix + 37,
prefix + 39,
prefix + 41,
prefix + 43,
prefix + 45]
);
System::set_block_number(1);
Session::check_rotate_session(System::block_number());
// Each exposure => total == own + sum(others)
Session::validators().iter().for_each(|acc| check_expo(Staking::stakers(acc-1)));
// aside from some error, stake must be divided correctly
assert!(
990000068998617227
- Session::validators()
.iter()
.map(|v| Staking::stakers(v-1))
.fold(0, |s, v| if v.others.len() > 0 { s + v.others[0].value } else { s })
< 100
);
// For manual inspection
println!("Validators are {:?}", Session::validators());
println!("Validators are {:#?}",
Session::validators().iter().map(|v| (v.clone(), Staking::stakers(v-1)) ).collect::<Vec<(u64, Exposure<u64, u64>)>>());
})
}