mega cleanup of staking tests (#9516)

* general cleanup of staking tests

* fix fishy test

* fix one more fishy test

* some review comments
This commit is contained in:
Kian Paimani
2021-08-11 15:34:03 +02:00
committed by GitHub
parent 61c0a65c9b
commit 8180c58700
3 changed files with 617 additions and 651 deletions
+4 -4
View File
@@ -494,13 +494,13 @@ pub mod pallet {
T::Currency::free_balance(&stash) >= balance,
"Stash does not have enough balance to bond."
);
let _ = <Pallet<T>>::bond(
frame_support::assert_ok!(<Pallet<T>>::bond(
T::Origin::from(Some(stash.clone()).into()),
T::Lookup::unlookup(controller.clone()),
balance,
RewardDestination::Staked,
);
let _ = match status {
));
frame_support::assert_ok!(match status {
StakerStatus::Validator => <Pallet<T>>::validate(
T::Origin::from(Some(controller.clone()).into()),
Default::default(),
@@ -510,7 +510,7 @@ pub mod pallet {
votes.iter().map(|l| T::Lookup::unlookup(l.clone())).collect(),
),
_ => Ok(()),
};
});
}
}
}