Skip to content

Commit fa4ced9

Browse files
authored
fix: intermittent failures in feature_asset_locks.py (dashpay#5875)
## Issue being fixed or feature implemented fix failures like https://gitlab.com/dashpay/dash/-/jobs/6175160403 ## What was done? use `minimumAmount` option in `listunspent` rpc call to avoid picking coins that are too small for asset lock txes ## How Has This Been Tested? run `feature_asset_locks.py` ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone
1 parent 015e30f commit fa4ced9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/functional/feature_asset_locks.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,8 @@ def test_asset_locks(self, node_wallet, node, pubkey):
273273
locked_1 = 10 * COIN + 141421
274274
locked_2 = 10 * COIN + 314159
275275

276-
coins = node_wallet.listunspent()
277-
coin = None
278-
while coin is None or COIN * coin['amount'] < locked_2:
279-
coin = coins.pop()
276+
coins = node_wallet.listunspent(query_options={'minimumAmount': Decimal(str(locked_2 / COIN))})
277+
coin = coins.pop()
280278
asset_lock_tx = self.create_assetlock(coin, locked_1, pubkey)
281279

282280

@@ -604,7 +602,7 @@ def test_mn_rr(self, node_wallet, node, pubkey):
604602
locked += platform_reward
605603
assert_equal(locked, self.get_credit_pool_balance())
606604

607-
coins = node_wallet.listunspent()
605+
coins = node_wallet.listunspent(query_options={'minimumAmount': 1})
608606
coin = coins.pop()
609607
self.send_tx(self.create_assetlock(coin, COIN, pubkey))
610608
locked += platform_reward + COIN

0 commit comments

Comments
 (0)