Skip to content

Commit 17c3b8a

Browse files
committed
fix tests
1 parent 611e177 commit 17c3b8a

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

test/functional/test_framework/wallet_rpc_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ async def create_stake_pool(self,
245245
return "The transaction was submitted successfully"
246246

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

251251
async def list_pool_ids(self) -> List[PoolData]:

wallet/src/wallet/tests.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3888,6 +3888,8 @@ fn sign_decommission_pool_request_between_accounts(#[case] seed: Seed) {
38883888
1,
38893889
);
38903890

3891+
assert_eq!(get_coin_balance(&wallet), Amount::ZERO);
3892+
38913893
let pool_ids = wallet.get_pool_ids(acc_0_index, WalletPoolsFilter::All).unwrap();
38923894
assert_eq!(pool_ids.len(), 1);
38933895

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

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

3926-
let currency_balances = wallet
3927-
.get_balance(
3928-
acc_1_index,
3929-
UtxoType::Transfer | UtxoType::LockThenTransfer | UtxoType::CreateStakePool,
3930-
UtxoState::Confirmed.into(),
3931-
WithLocked::Unlocked,
3932-
)
3933-
.unwrap();
3934-
assert_eq!(
3935-
currency_balances.get(&Currency::Coin).copied().unwrap_or(Amount::ZERO),
3936-
pool_amount,
3937-
);
3928+
// the pool amount is back after decommission
3929+
assert_eq!(get_coin_balance(&wallet), pool_amount);
3930+
assert_eq!(get_coin_balance_for_acc(&wallet, acc_1_index), Amount::ZERO);
39383931
}
39393932

39403933
#[rstest]
@@ -4020,7 +4013,7 @@ fn sign_decommission_pool_request_cold_wallet(#[case] seed: Seed) {
40204013
&mut hot_wallet,
40214014
vec![signed_tx],
40224015
Amount::ZERO,
4023-
1,
4016+
2,
40244017
);
40254018

40264019
let currency_balances = hot_wallet

0 commit comments

Comments
 (0)