Skip to content

Commit

Permalink
refactor(tests): simplify address creation in test_blocks
Browse files Browse the repository at this point in the history
Simplified the creation of payment addresses in TestDynamicBlockProd by
removing the use of fixture_cache.
The caching is not needed as the fixture is used by single test.
  • Loading branch information
mkoura committed Oct 2, 2024
1 parent 9708c55 commit 0447202
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions cardano_node_tests/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,12 @@ def payment_addrs(
"""Create new payment addresses."""
cluster = cluster_singleton

with cluster_manager.cache_fixture() as fixture_cache:
if fixture_cache.value:
return fixture_cache.value # type: ignore

addrs = clusterlib_utils.create_payment_addr_records(
*[f"addr_dyn_prod_ci{cluster_manager.cluster_instance_num}_{i}" for i in range(20)],
cluster_obj=cluster,
)
fixture_cache.value = addrs
addrs = clusterlib_utils.create_payment_addr_records(
*[f"addr_dyn_prod_ci{cluster_manager.cluster_instance_num}_{i}" for i in range(20)],
cluster_obj=cluster,
)

# fund source addresses
# Fund source addresses
clusterlib_utils.fund_from_faucet(
*addrs,
cluster_obj=cluster,
Expand Down

0 comments on commit 0447202

Please sign in to comment.