Skip to content

Commit e4559cf

Browse files
committed
refactor(common): improve funding logic for addresses
Refactored the `_get_funded_addresses` function to handle the `amount` parameter more explicitly. If `amount` is provided, it is used for both `fund_amount` and `min_amount`. Otherwise, default values are applied. This change improves code clarity.
1 parent 18f50d4 commit e4559cf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cardano_node_tests/tests/common.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,14 @@ def _get_funded_addresses(
349349
If `amount` is provided, fund once and never re-fund.
350350
If `amount` is not provided, re-fund when balance drops below `min_amount`.
351351
"""
352-
fund_amount = amount or 150_000_000
353-
# Re-fund the addresses if the amount is lower than this
354-
min_amount = 50_000_000
352+
if amount is None:
353+
fund_amount = 150_000_000
354+
# Re-fund the addresses if the amount is lower than this
355+
min_amount = 50_000_000
356+
else:
357+
# Use the exact specified amount
358+
fund_amount = amount
359+
min_amount = amount
355360

356361
if caching_key:
357362
fixture_cache: cluster_management.FixtureCache[list | None]

0 commit comments

Comments
 (0)