Skip to content

Commit

Permalink
init and upgrade staking test to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yanganto committed Feb 27, 2020
1 parent 68ed099 commit 8e78068
Show file tree
Hide file tree
Showing 2 changed files with 4,408 additions and 4,430 deletions.
8 changes: 8 additions & 0 deletions frame/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,14 @@ pub fn check_exposure(stash: AccountId) {
// );
}

pub fn assert_ledger_consistent(stash: u64) {
assert_is_stash(stash);
let ledger = Staking::ledger(stash - 1).unwrap();

assert_eq!(ledger.active_ring, ledger.ring_staking_lock.staking_amount);
assert_eq!(ledger.active_kton, ledger.kton_staking_lock.staking_amount);
}

/// Check that for each nominator: slashable_balance > sum(used_balance)
/// Note: we might not consume all of a nominator's balance, but we MUST NOT over spend it.
pub fn check_nominator_exposure(stash: AccountId) {
Expand Down
Loading

0 comments on commit 8e78068

Please sign in to comment.