Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OBorce committed Jan 29, 2024
1 parent 611e177 commit 17c3b8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/functional/test_framework/wallet_rpc_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ async def create_stake_pool(self,
return "The transaction was submitted successfully"

async def decommission_stake_pool(self, pool_id: str) -> str:
self._write_command("staking_decommission_pool", [self.account, pool_id, {'in_top_x_mb': 5}])['result']
self._write_command("staking_decommission_pool", [self.account, pool_id, None, {'in_top_x_mb': 5}])['result']
return "The transaction was submitted successfully"

async def list_pool_ids(self) -> List[PoolData]:
Expand Down
21 changes: 7 additions & 14 deletions wallet/src/wallet/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,8 @@ fn sign_decommission_pool_request_between_accounts(#[case] seed: Seed) {
1,
);

assert_eq!(get_coin_balance(&wallet), Amount::ZERO);

let pool_ids = wallet.get_pool_ids(acc_0_index, WalletPoolsFilter::All).unwrap();
assert_eq!(pool_ids.len(), 1);

Expand Down Expand Up @@ -3921,20 +3923,11 @@ fn sign_decommission_pool_request_between_accounts(#[case] seed: Seed) {
.into_signed_tx()
.unwrap();

let _ = create_block(&chain_config, &mut wallet, vec![signed_tx], Amount::ZERO, 1);
let _ = create_block(&chain_config, &mut wallet, vec![signed_tx], Amount::ZERO, 2);

let currency_balances = wallet
.get_balance(
acc_1_index,
UtxoType::Transfer | UtxoType::LockThenTransfer | UtxoType::CreateStakePool,
UtxoState::Confirmed.into(),
WithLocked::Unlocked,
)
.unwrap();
assert_eq!(
currency_balances.get(&Currency::Coin).copied().unwrap_or(Amount::ZERO),
pool_amount,
);
// the pool amount is back after decommission
assert_eq!(get_coin_balance(&wallet), pool_amount);
assert_eq!(get_coin_balance_for_acc(&wallet, acc_1_index), Amount::ZERO);
}

#[rstest]
Expand Down Expand Up @@ -4020,7 +4013,7 @@ fn sign_decommission_pool_request_cold_wallet(#[case] seed: Seed) {
&mut hot_wallet,
vec![signed_tx],
Amount::ZERO,
1,
2,
);

let currency_balances = hot_wallet
Expand Down

0 comments on commit 17c3b8a

Please sign in to comment.