Skip to content

Commit

Permalink
Merge pull request #2662 from IntersectMBO/block_production_epoch
Browse files Browse the repository at this point in the history
Block production epoch
  • Loading branch information
mkoura authored Oct 2, 2024
2 parents 9708c55 + 106cf4b commit 577a00b
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 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 Expand Up @@ -452,16 +447,8 @@ def _save_state(curr_epoch: int) -> tp.Dict[str, int]:
blocks_before: tp.Dict[str, int] = ledger_state["blocksBefore"]
return blocks_before

# Blocks are produced by BFT node in Byron epoch and first Shelley epoch on local cluster
# that starts in Byron era.
if (
cluster_nodes.get_cluster_type().type == cluster_nodes.ClusterType.LOCAL
and not cluster_nodes.get_cluster_type().uses_shortcut
):
cluster.wait_for_epoch(epoch_no=2)

# The network needs to be at least in epoch 1
cluster.wait_for_epoch(epoch_no=1)
# The network needs to be at least in epoch 2
cluster.wait_for_epoch(epoch_no=2)

# Wait for the epoch to be at least half way through and not too close to the end.
# We want the original pool to have time to forge blocks in this epoch, before it becomes
Expand Down

0 comments on commit 577a00b

Please sign in to comment.