Skip to content

Commit

Permalink
fix: tests fixed and weights updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ipapandinas committed Jan 13, 2025
1 parent d94b330 commit 68edd56
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 103 deletions.
18 changes: 9 additions & 9 deletions pallets/dapp-staking/src/test/tests_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2527,20 +2527,20 @@ fn move_stake_basic() {
);

// Verify source staking info
assert_eq!(source_staking_info.staked.voting, 20); // 100 - 80
assert_eq!(source_staking_info.staked.build_and_earn, 50); // Unchanged
assert_eq!(source_staking_info.staked.voting, 70); // 100 - 30
assert_eq!(source_staking_info.staked.build_and_earn, 0);
assert_eq!(source_staking_info.staked.era, current_era);

// Verify destination staking info
assert_eq!(destination_staking_info.staked.voting, 80);
assert_eq!(destination_staking_info.staked.build_and_earn, 0);
assert_eq!(destination_staking_info.staked.voting, 30);
assert_eq!(destination_staking_info.staked.build_and_earn, 50);
assert_eq!(destination_staking_info.staked.era, current_era + 1); // Stake valid from next era

// Verify return values
assert_eq!(era_and_amount_pairs.len(), 1);
assert_eq!(era_and_amount_pairs.len(), 2);
assert_eq!(era_and_amount_pairs[0], (current_era, move_amount));
assert_eq!(stake_moved.voting, 80);
assert_eq!(stake_moved.build_and_earn, 0);
assert_eq!(stake_moved.voting, 30);
assert_eq!(stake_moved.build_and_earn, 50);
}

#[test]
Expand Down Expand Up @@ -2570,15 +2570,15 @@ fn move_stake_full_transfer() {
// Verify source staking info is emptied
assert_eq!(source_staking_info.staked.voting, 0);
assert_eq!(source_staking_info.staked.build_and_earn, 0);
assert_eq!(source_staking_info.staked.era, current_era);
assert_eq!(source_staking_info.staked.era, 0); // Staked is empty - Default value expected

// Verify destination staking info - full transfer
assert_eq!(destination_staking_info.staked.voting, 50);
assert_eq!(destination_staking_info.staked.build_and_earn, 50);
assert_eq!(destination_staking_info.staked.era, current_era + 1);

// Verify return values
assert_eq!(era_and_amount_pairs.len(), 1);
assert_eq!(era_and_amount_pairs.len(), 2);
assert_eq!(era_and_amount_pairs[0], (current_era, move_amount));
assert_eq!(stake_moved.voting, 50);
assert_eq!(stake_moved.build_and_earn, 50);
Expand Down
Loading

0 comments on commit 68edd56

Please sign in to comment.