Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
re-gius committed Dec 3, 2024
1 parent c3365a6 commit 584fe53
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ fn pool_chill_e2e() {
pallet_staking::ConfigOp::Noop,
pallet_staking::ConfigOp::Noop,
pallet_staking::ConfigOp::Noop,
pallet_staking::ConfigOp::Noop,
));

// members can unbond as long as total stake of the pool is above min nominator bond
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
pallet_staking::ConfigOp::Noop,
pallet_staking::ConfigOp::Noop,
pallet_staking::ConfigOp::Noop,
pallet_staking::ConfigOp::Noop,
));
});

Expand Down
32 changes: 19 additions & 13 deletions substrate/frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2329,8 +2329,10 @@ fn reward_validator_slashing_validator_does_not_overflow() {
let exposure = Exposure::<AccountId, Balance> { total: stake, own: stake, others: vec![] };
let mut reward_map = BoundedBTreeMap::new();
assert_ok!(reward_map.try_insert(11, 1));
let reward =
EraRewardPoints::<AccountId, MaxValidatorsCount> { total: 1, individual: reward_map };
let reward = EraRewardPoints::<AccountId, <Test as Config>::MaxValidatorsCount> {
total: 1,
individual: reward_map,
};

// Check reward
ErasRewardPoints::<Test>::insert(0, reward);
Expand Down Expand Up @@ -6609,7 +6611,10 @@ fn should_retain_era_info_only_upto_history_depth() {
for page in 0..3 {
ErasStakersPaged::<Test>::insert(
(era, &validator_stash, page),
ExposurePage { page_total: 100, others: WeakBoundedVec::new() },
ExposurePage {
page_total: 100,
others: WeakBoundedVec::force_from(vec![], None),
},
);
}
}
Expand Down Expand Up @@ -6657,8 +6662,10 @@ fn test_runtime_api_pending_rewards() {
assert_ok!(reward_map.try_insert(validator_two, 1));
assert_ok!(reward_map.try_insert(validator_three, 1));
// Add reward points
let reward =
EraRewardPoints::<AccountId, MaxValidatorsCount> { total: 1, individual: reward_map };
let reward = EraRewardPoints::<AccountId, <Test as Config>::MaxValidatorsCount> {
total: 1,
individual: reward_map,
};
ErasRewardPoints::<Test>::insert(0, reward);

// build exposure
Expand Down Expand Up @@ -8499,11 +8506,9 @@ mod migration_tests {
mod getters {
use crate::{
mock::{self},
pallet::pallet::{
Invulnerables, MaxValidatorsCount, MinimumValidatorCount, ValidatorCount,
},
pallet::pallet::{Invulnerables, MinimumValidatorCount, ValidatorCount},
slashing,
tests::{MaxWinners, Staking, Test, WeakBoundedVec},
tests::{Staking, Test, WeakBoundedVec},
ActiveEra, ActiveEraInfo, BalanceOf, BoundedBTreeMap, BoundedVec, CanceledSlashPayout,
ClaimedRewards, CurrentEra, CurrentPlannedSession, EraRewardPoints, ErasRewardPoints,
ErasStartSessionIndex, ErasTotalStake, ErasValidatorPrefs, ErasValidatorReward, ForceEra,
Expand Down Expand Up @@ -8705,10 +8710,11 @@ mod getters {
let era: EraIndex = 12;
let mut reward_map = BoundedBTreeMap::new();
frame_support::assert_ok!(reward_map.try_insert(11, 1));
let reward_points = EraRewardPoints::<mock::AccountId, MaxValidatorsCount> {
total: 1,
individual: reward_map,
};
let reward_points =
EraRewardPoints::<mock::AccountId, <Test as Config>::MaxValidatorsCount> {
total: 1,
individual: reward_map,
};
ErasRewardPoints::<Test>::insert(era, reward_points);

// when
Expand Down

0 comments on commit 584fe53

Please sign in to comment.