Skip to content

Commit 5d0a401

Browse files
Merge branch 'master' into build_method_test_pools
2 parents 911661d + c9c14b7 commit 5d0a401

File tree

7 files changed

+252
-238
lines changed

7 files changed

+252
-238
lines changed

cardano_node_tests/cluster_scripts/testnets/start-cluster

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ TESTNET_DIR="${1:?"Testnet dir needed"}"
77
SCRIPT_DIR="$(readlink -m "${0%/*}")"
88
SOCKET_PATH="$(readlink -m "$CARDANO_NODE_SOCKET_PATH")"
99
STATE_CLUSTER="${SOCKET_PATH%/*}"
10+
# Fail if PWD is STATE_CLUSTER, as STATE_CLUSTER will be deleted
11+
if [ "$PWD" = "$STATE_CLUSTER" ]; then
12+
echo "Please run this script from outside of '$STATE_CLUSTER'" >&2
13+
exit 1
14+
fi
1015
STATE_CLUSTER_NAME="${STATE_CLUSTER##*/}"
1116
SUPERVISORD_SOCKET_PATH="${STATE_CLUSTER}/supervisord.sock"
1217
START_CLUSTER_LOG="${STATE_CLUSTER}/start-cluster.log"
@@ -31,7 +36,10 @@ if [ -e "$SCRIPT_DIR/shell_env" ]; then
3136
source "$SCRIPT_DIR/shell_env"
3237
fi
3338

34-
rm -rf "$STATE_CLUSTER"
39+
if ! ( rm -rf "$STATE_CLUSTER" || rm -rf "$STATE_CLUSTER"; ); then
40+
echo "Could not remove existing '$STATE_CLUSTER'" >&2
41+
exit 1
42+
fi
3543
mkdir -p "$STATE_CLUSTER"/{byron,shelley,webserver}
3644
cd "$STATE_CLUSTER/.."
3745

cardano_node_tests/tests/common.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ def get_payment_addrs(
454454
caching_key: str = "",
455455
amount: int | None = None,
456456
min_amount: int | None = None,
457+
key_gen_method: clusterlib_utils.KeyGenMethods = clusterlib_utils.KeyGenMethods.DIRECT,
457458
) -> list[clusterlib.AddressRecord]:
458459
"""Create new payment addresses."""
459460
if num < 1:
@@ -464,6 +465,7 @@ def _create_addrs() -> list[clusterlib.AddressRecord]:
464465
addrs = clusterlib_utils.create_payment_addr_records(
465466
*[f"{name_template}_fund_addr_{i}" for i in range(1, num + 1)],
466467
cluster_obj=cluster_obj,
468+
key_gen_method=key_gen_method,
467469
)
468470
return addrs
469471

@@ -486,6 +488,7 @@ def get_payment_addr(
486488
caching_key: str = "",
487489
amount: int | None = None,
488490
min_amount: int | None = None,
491+
key_gen_method: clusterlib_utils.KeyGenMethods = clusterlib_utils.KeyGenMethods.DIRECT,
489492
) -> clusterlib.AddressRecord:
490493
"""Create a single new payment address."""
491494
return get_payment_addrs(
@@ -496,6 +499,7 @@ def get_payment_addr(
496499
caching_key=caching_key,
497500
amount=amount,
498501
min_amount=min_amount,
502+
key_gen_method=key_gen_method,
499503
)[0]
500504

501505

@@ -508,6 +512,7 @@ def get_pool_users(
508512
caching_key: str = "",
509513
amount: int | None = None,
510514
min_amount: int | None = None,
515+
payment_key_gen_method: clusterlib_utils.KeyGenMethods = clusterlib_utils.KeyGenMethods.DIRECT,
511516
) -> list[clusterlib.PoolUser]:
512517
"""Create new pool users."""
513518
if num < 1:
@@ -519,6 +524,7 @@ def _create_pool_users() -> list[clusterlib.PoolUser]:
519524
cluster_obj=cluster_obj,
520525
name_template=f"{name_template}_pool_user",
521526
no_of_addr=num,
527+
payment_key_gen_method=payment_key_gen_method,
522528
)
523529
return users
524530

@@ -541,6 +547,7 @@ def get_pool_user(
541547
caching_key: str = "",
542548
amount: int | None = None,
543549
min_amount: int | None = None,
550+
payment_key_gen_method: clusterlib_utils.KeyGenMethods = clusterlib_utils.KeyGenMethods.DIRECT,
544551
) -> clusterlib.PoolUser:
545552
"""Create a single new pool user."""
546553
return get_pool_users(
@@ -551,6 +558,7 @@ def get_pool_user(
551558
caching_key=caching_key,
552559
amount=amount,
553560
min_amount=min_amount,
561+
payment_key_gen_method=payment_key_gen_method,
554562
)[0]
555563

556564

cardano_node_tests/tests/test_tx_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def payment_addrs_disposable(
8989
cluster_manager=cluster_manager,
9090
cluster_obj=cluster,
9191
num=2,
92+
key_gen_method=clusterlib_utils.KeyGenMethods.MNEMONIC,
9293
)
9394
return addrs
9495

0 commit comments

Comments
 (0)