diff --git a/scripts/multi-node/cross-node-transaction-test.sh b/scripts/multi-node/cross-node-transaction-test.sh index b8263e45..d37b9d2c 100755 --- a/scripts/multi-node/cross-node-transaction-test.sh +++ b/scripts/multi-node/cross-node-transaction-test.sh @@ -74,12 +74,24 @@ create_test_wallet() { # Get wallet address get_wallet_address() { local wallet_name="$1" - # Try different wallet address command syntaxes - local address=$(${CLI_PATH} wallet address --name "${wallet_name}" 2>/dev/null || echo "") - if [ -z "$address" ]; then - # Try alternative syntax - address=$(${CLI_PATH} wallet list --name "${wallet_name}" 2>/dev/null | grep -o "ait1[a-z0-9]*" | head -1 || echo "") + + # Check if CLI exists and is executable + if [ ! -x "${CLI_PATH}" ]; then + log_error "CLI not found or not executable: ${CLI_PATH}" + echo "" + return 1 fi + + # Try different wallet address command syntaxes + local address=$(${CLI_PATH} wallet address --name "${wallet_name}" 2>&1) + local exit_code=$? + + if [ $exit_code -ne 0 ] || [ -z "$address" ]; then + log_warning "wallet address command failed (exit code: ${exit_code}, output: ${address})" + # Try alternative syntax + address=$(${CLI_PATH} wallet list --name "${wallet_name}" 2>&1 | grep -o "ait1[a-z0-9]*" | head -1 || echo "") + fi + echo "$address" }