1111
1212 bashInteractive = pkgs . bashInteractive ;
1313 coreutils = pkgs . coreutils ;
14+ wget = pkgs . wget ;
1415 jq = pkgs . jq ;
1516 # Avoid rebuilding on every commit because of `set-git-rev`.
1617 cardano-cli = pkgs . cardanoNodePackages . cardano-cli . passthru . noGitRev ;
@@ -347,6 +348,14 @@ function governance_create_constitution {
347348 | ${ jq } /bin/jq -r \
348349 '.nextRatifyState.nextEnactState.prevGovActionIds'
349350
351+ # Copy base-line anchor.
352+ ${ wget } /bin/wget \
353+ --output-document ./constitution.anchor.json \
354+ "https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0100/cip-0100.common.schema.json"
355+ # Calculate anchor hash.
356+ ${ cardano-cli } /bin/cardano-cli hash anchor-data \
357+ --file-text ./constitution.anchor.json \
358+ --out-file ./constitution.anchor.hash
350359 # Create dummy constitution.
351360 ${ coreutils } /bin/echo "My Constitution: free mate and asado" \
352361 > ./constitution.txt
@@ -368,7 +377,7 @@ function governance_create_constitution {
368377 ${ cardano-cli } /bin/cardano-cli conway governance action create-constitution \
369378 --testnet \
370379 --anchor-url "https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0100/cip-0100.common.schema.json" \
371- --anchor-data-hash "9d99fbca260b2d77e6d3012204e1a8658f872637ae94cdb1d8a53f4369400aa9 " \
380+ --anchor-data-hash "$( ${ coreutils } /bin/cat ./constitution.anchor.hash) " \
372381 --constitution-url "https://ipfs.io/ipfs/Qmdo2J5vkGKVu2ur43PuTrM7FdaeyfeFav8fhovT6C2tto" \
373382 --constitution-hash "$(${ coreutils } /bin/cat ./constitution.hash)" \
374383 --constitution-script-hash "$(${ coreutils } /bin/cat ./guardrails-script.hash)" \
@@ -438,12 +447,21 @@ function governance_create_withdrawal {
438447 local funds_tx
439448 funds_tx="$(get_address_utxo_expected_id "'' ${node_drep_addr}")"
440449
450+ # Copy base-line anchor.
451+ ${ wget } /bin/wget \
452+ --output-document ./treasury-withdrawal.json \
453+ "https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0108/examples/treasury-withdrawal.jsonld"
454+ # Calculate anchor hash.
455+ ${ cardano-cli } /bin/cardano-cli hash anchor-data \
456+ --file-text ./treasury-withdrawal.json \
457+ --out-file ./treasury-withdrawal.hash
458+
441459 local tx_filename=./create-withdrawal."'' ${node_str}"."'' ${drep_i}"
442460 # Create action.
443461 ${ cardano-cli } /bin/cardano-cli conway governance action create-treasury-withdrawal \
444462 --testnet \
445463 --anchor-url "https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0108/examples/treasury-withdrawal.jsonld" \
446- --anchor-data-hash "311b148ca792007a3b1fee75a8698165911e306c3bc2afef6cf0145ecc7d03d4" \
464+ --anchor-data-hash "$( ${ coreutils } /bin/cat ./treasury-withdrawal.hash)" \
447465 --governance-action-deposit "'' ${action_deposit}" \
448466 --transfer 50 \
449467 --deposit-return-stake-verification-key-file ../../genesis/cache-entry/stake-delegators/"delegator'' ${node_i}"/staking.vkey \
0 commit comments