Skip to content

Commit eb803cc

Browse files
committed
feat(tests): add name_template and tx_name for funding
Enhance funding-related functions by introducing `name_template` and `tx_name` parameters. These changes improve traceability and customization for transactions and address creation. - Updated `detect_fork` to use `tx_name` and modified `name`. - Added `name_template` parameter to `_get_funded_addresses`. - Passed `name_template` and `tx_name` to relevant calls in `get_payment_addrs` and `get_pool_users`.
1 parent 183f66e commit eb803cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cardano_node_tests/tests/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,14 @@ def detect_fork(
246246

247247
# Create a UTxO
248248
payment_rec = cluster_obj.g_address.gen_payment_addr_and_keys(
249-
name=temp_template,
249+
name=f"{temp_template}_fork",
250250
)
251251
tx_raw_output = clusterlib_utils.fund_from_faucet(
252252
payment_rec,
253253
cluster_obj=cluster_obj,
254254
all_faucets=cluster_manager.cache.addrs_data,
255255
amount=2_000_000,
256+
tx_name=f"{temp_template}_fork",
256257
)
257258
assert tx_raw_output
258259
utxos = cluster_obj.g_query.get_utxo(tx_raw_output=tx_raw_output)
@@ -337,6 +338,7 @@ def get_conway_address_deposit(cluster_obj: clusterlib.ClusterLib) -> int:
337338

338339

339340
def _get_funded_addresses(
341+
name_template: str,
340342
cluster_manager: cluster_management.ClusterManager,
341343
cluster_obj: clusterlib.ClusterLib,
342344
create_func: tp.Callable[[], list],
@@ -386,6 +388,7 @@ def _get_funded_addresses(
386388
cluster_obj=cluster_obj,
387389
all_faucets=cluster_manager.cache.addrs_data,
388390
amount=fund_amount,
391+
tx_name=f"{name_template}_addrs",
389392
force=True,
390393
)
391394

@@ -414,6 +417,7 @@ def _create_addrs() -> list[clusterlib.AddressRecord]:
414417
return addrs
415418

416419
return _get_funded_addresses(
420+
name_template=name_template,
417421
cluster_manager=cluster_manager,
418422
cluster_obj=cluster_obj,
419423
create_func=_create_addrs,
@@ -464,6 +468,7 @@ def _create_pool_users() -> list[clusterlib.PoolUser]:
464468
return users
465469

466470
return _get_funded_addresses(
471+
name_template=name_template,
467472
cluster_manager=cluster_manager,
468473
cluster_obj=cluster_obj,
469474
create_func=_create_pool_users,

0 commit comments

Comments
 (0)