Skip to content

Commit 57f7ca7

Browse files
committed
fix: cardano-cli breaking changes in 10.11.0.0 for ci
1 parent 41a3a89 commit 57f7ca7

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

flakeModules/jobs.nix

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ in {
9494
# Some code paths may not use the era bundled cli
9595
# shellcheck disable=SC2034
9696
CARDANO_CLI=("''${CARDANO_CLI_NO_ERA[@]}" "''${ERA_CMD:+$ERA_CMD}")
97+
98+
# Use a cardano-cli breaking change marker to handle version specific breaking changes
99+
if [ "$(printf "%s\n10.11.0.0" "$("''${CARDANO_CLI_NO_ERA[@]}" --version)" | sort -V | head -n 1)" = "10.11.0.0" ]; then
100+
# shellcheck disable=SC2034
101+
CARDANO_CLI_BREAKING="true"
102+
else
103+
# shellcheck disable=SC2034
104+
CARDANO_CLI_BREAKING="false"
105+
fi
97106
'';
98107

99108
updateProposalTemplate = ''
@@ -166,11 +175,19 @@ in {
166175
function create_proposal {
167176
TARGET_EPOCH="$1"
168177
169-
"''${CARDANO_CLI_NO_ERA[@]}" legacy governance create-update-proposal \
170-
--epoch "$TARGET_EPOCH" \
171-
"''${PROPOSAL_ARGS[@]}" \
172-
"''${PROPOSAL_KEY_ARGS[@]}" \
173-
--out-file update.proposal
178+
if [ "$CARDANO_CLI_BREAKING" = "true" ]; then
179+
"''${CARDANO_CLI_NO_ERA[@]}" compatible "''${ERA_CMD:-alonzo}" governance action create-protocol-parameters-update \
180+
--epoch "$TARGET_EPOCH" \
181+
"''${PROPOSAL_ARGS[@]}" \
182+
"''${PROPOSAL_KEY_ARGS[@]}" \
183+
--out-file update.proposal
184+
else
185+
"''${CARDANO_CLI_NO_ERA[@]}" legacy governance create-update-proposal \
186+
--epoch "$TARGET_EPOCH" \
187+
"''${PROPOSAL_ARGS[@]}" \
188+
"''${PROPOSAL_KEY_ARGS[@]}" \
189+
--out-file update.proposal
190+
fi
174191
175192
"''${CARDANO_CLI_NO_ERA[@]}" compatible "''${ERA_CMD:-alonzo}" transaction signed-transaction \
176193
--tx-in "$TXIN" \
@@ -2058,8 +2075,8 @@ in {
20582075
${selectCardanoCli}
20592076
20602077
"''${CARDANO_CLI_NO_ERA[@]}" latest governance committee create-hot-key-authorization-certificate \
2061-
--cold-verification-key-file "$CC_DIR"/cc-"$INDEX"-cold.vkey \
2062-
--hot-verification-key-file "$CC_DIR"/cc-"$INDEX"-hot.vkey \
2078+
--cold-verification-key-file "$(decrypt_check "$CC_DIR"/cc-"$INDEX"-cold.vkey)" \
2079+
--hot-verification-key-file "$(decrypt_check "$CC_DIR"/cc-"$INDEX"-hot.vkey)" \
20632080
--out-file cc-"$INDEX"-reg.cert
20642081
20652082
WITNESSES=2
@@ -2090,7 +2107,7 @@ in {
20902107
--tx-body-file tx-cc-"$INDEX".txbody \
20912108
--out-file tx-cc-"$INDEX".txsigned \
20922109
--signing-key-file "$(decrypt_check "$PAYMENT_KEY".skey)" \
2093-
--signing-key-file "$CC_DIR"/cc-"$INDEX"-cold.skey
2110+
--signing-key-file "$(decrypt_check "$CC_DIR"/cc-"$INDEX"-cold.skey)"
20942111
20952112
fd --type file . "$CC_DIR"/ --exec bash -c 'encrypt_check {}'
20962113
@@ -2121,12 +2138,12 @@ in {
21212138
mkdir -p "$CC_DIR"
21222139
21232140
"''${CARDANO_CLI_NO_ERA[@]}" latest governance committee key-gen-cold \
2124-
--verification-key-file "$CC_DIR"/cc-"$INDEX"-cold.vkey \
2125-
--signing-key-file "$CC_DIR"/cc-"$INDEX"-cold.skey
2141+
--verification-key-file "$(decrypt_check "$CC_DIR"/cc-"$INDEX"-cold.vkey)" \
2142+
--signing-key-file "$(decrypt_check "$CC_DIR"/cc-"$INDEX"-cold.skey)"
21262143
21272144
"''${CARDANO_CLI_NO_ERA[@]}" latest governance committee key-gen-hot \
2128-
--verification-key-file "$CC_DIR"/cc-"$INDEX"-hot.vkey \
2129-
--signing-key-file "$CC_DIR"/cc-"$INDEX"-hot.skey
2145+
--verification-key-file "$(decrypt_check "$CC_DIR"/cc-"$INDEX"-hot.vkey)" \
2146+
--signing-key-file "$(decrypt-check "$CC_DIR"/cc-"$INDEX"-hot.skey)"
21302147
'';
21312148
};
21322149

0 commit comments

Comments
 (0)