Skip to content

Commit

Permalink
merged in with evan
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Krueger authored and Christian Krueger committed Jul 23, 2024
2 parents 7b18620 + 4369738 commit 17dcc07
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/tests/steward/test_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,15 +965,6 @@ async fn test_rebalance_increase() {
&serialized_stake_pool_account(stake_pool_spl, std::mem::size_of::<StakePool>()).into(),
);

let mut steward_state_account: StewardStateAccount =
fixture.load_and_deserialize(&fixture.steward_state).await;

steward_state_account.state.num_pool_validators += 1;
ctx.borrow_mut().set_account(
&fixture.steward_state,
&serialized_steward_state_account(steward_state_account).into(),
);

let (stake_account_address, transient_stake_account_address, withdraw_authority) =
fixture.stake_accounts_for_validator(vote_account).await;

Expand Down Expand Up @@ -1052,6 +1043,17 @@ async fn test_rebalance_increase() {
&serialized_steward_state_account(steward_state_account).into(),
);

let mut steward_state_account: StewardStateAccount =
fixture.load_and_deserialize(&fixture.steward_state).await;

// Force validator into the active set, don't wait for next cycle
steward_state_account.state.num_pool_validators += 1;
steward_state_account.state.validators_added -= 1;
ctx.borrow_mut().set_account(
&fixture.steward_state,
&serialized_steward_state_account(steward_state_account).into(),
);

let reserve_before_rebalance = fixture.get_account(&fixture.stake_pool_meta.reserve).await;

let tx = Transaction::new_signed_with_payer(
Expand Down Expand Up @@ -1264,7 +1266,7 @@ async fn test_rebalance_decrease() {
fixture.load_and_deserialize(&fixture.steward_state).await;

// Force validator into the active set, don't wait for next cycle
steward_state_account.state.num_pool_validators += 1;
// steward_state_account.state.num_pool_validators += 1;
steward_state_account.state.validators_added -= 1;
ctx.borrow_mut().set_account(
&fixture.steward_state,
Expand Down

0 comments on commit 17dcc07

Please sign in to comment.