From faf7190a760b2ea4d67eed4882a560a1912d6167 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 1 Jun 2026 16:57:33 +0100 Subject: [PATCH 1/2] update cardano-cli and cardano-signer versions in preflight --- scripts/preflight.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/preflight.sh b/scripts/preflight.sh index 8de05f8..3eaf390 100755 --- a/scripts/preflight.sh +++ b/scripts/preflight.sh @@ -10,8 +10,8 @@ source "$SCRIPT_DIR/lib/messages.sh" # component, preflight WARNs (never fails) — these are advisory, not hard # requirements. Leave blank to skip the version check for a tool. -cardano_cli_version="cardano-cli 10.8.0" -cardano_signer_version="cardano-signer 1.27.0" +cardano_cli_version="cardano-cli 11.0.0" +cardano_signer_version="cardano-signer 1.34.0" jq_version="1.7.1" curl_version="8.7.1" ipfs_version="0.38.2" From 696797c9c867f78d9a4dbe71cfb6fff3ba35ae14 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 2 Jun 2026 09:27:36 +0100 Subject: [PATCH 2/2] small hardens against future changes --- scripts/action-create-info.sh | 5 ++++- scripts/action-create-tw.sh | 10 ++++++++-- scripts/lib/messages.sh | 13 +++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/scripts/action-create-info.sh b/scripts/action-create-info.sh index 87e6dfa..873811e 100755 --- a/scripts/action-create-info.sh +++ b/scripts/action-create-info.sh @@ -283,9 +283,12 @@ print_section "Creating action file" action_file="$input_file.action" action_json="$input_file.action.json" +gov_action_deposit=$(cardano-cli conway query gov-state | jq -r '.currentPParams.govActionDeposit') +require_nonnull "$gov_action_deposit" "governance action deposit (gov-state .currentPParams.govActionDeposit)" + cardano-cli conway governance action create-info \ --$protocol_magic \ - --governance-action-deposit $(cardano-cli conway query gov-state | jq -r '.currentPParams.govActionDeposit') \ + --governance-action-deposit "$gov_action_deposit" \ --deposit-return-stake-address "$deposit_return" \ --anchor-url "ipfs://$ipfs_cid" \ --anchor-data-hash "$file_hash" \ diff --git a/scripts/action-create-tw.sh b/scripts/action-create-tw.sh index bb6e083..36f96a3 100755 --- a/scripts/action-create-tw.sh +++ b/scripts/action-create-tw.sh @@ -427,16 +427,22 @@ print_section "Creating action file" action_file="$input_file.action" action_json="$input_file.action.json" +gov_action_deposit=$(cardano-cli conway query gov-state | jq -r '.currentPParams.govActionDeposit') +require_nonnull "$gov_action_deposit" "governance action deposit (gov-state .currentPParams.govActionDeposit)" + +constitution_script_hash=$(cardano-cli conway query constitution | jq -r '.script') +require_nonnull "$constitution_script_hash" "constitution script hash (constitution .script)" + cardano-cli conway governance action create-treasury-withdrawal \ --$protocol_magic \ - --governance-action-deposit $(cardano-cli conway query gov-state | jq -r '.currentPParams.govActionDeposit') \ + --governance-action-deposit "$gov_action_deposit" \ --deposit-return-stake-address "$deposit_return" \ --anchor-url "ipfs://$ipfs_cid" \ --anchor-data-hash "$file_hash" \ --check-anchor-data \ --funds-receiving-stake-address "$withdrawal_address" \ --transfer "$withdrawal_amount" \ - --constitution-script-hash $(cardano-cli conway query constitution | jq -r '.script') \ + --constitution-script-hash "$constitution_script_hash" \ --out-file "$action_file" print_pass "Action file created at $(fmt_path "$action_file")" diff --git a/scripts/lib/messages.sh b/scripts/lib/messages.sh index 5ad5aba..eb1aa5c 100644 --- a/scripts/lib/messages.sh +++ b/scripts/lib/messages.sh @@ -91,6 +91,19 @@ fmt_path() { printf "'%s%s%s'" "$YELLOW" "$1" "$NC" } +# Abort with a clear [FAIL] if a value pulled from a cardano-cli/jq query is +# empty or the literal "null". Guards against a renamed/reshaped query field +# (e.g. across a cardano-cli upgrade) silently feeding a bad value into a +# downstream command flag. Usage: require_nonnull "$value" "human label" +require_nonnull() { + local value="$1" label="$2" + if [ -z "$value" ] || [ "$value" = "null" ]; then + print_fail "Could not read $label from cardano-cli output (got empty/null)." + print_hint "This can happen if cardano-cli's output format changed or the node is not synced." + exit 1 + fi +} + # Single help row, replacing ad-hoc col=50 printf blocks. print_usage_option() { printf ' %s%-42s%s %s%s%s\n' "$GREEN" "$1" "$NC" "$GRAY" "$2" "$NC"