From 9fe6ea32e43af6cd53d0ec597500ccfb1dcc0494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Thu, 9 Nov 2023 11:34:14 +0100 Subject: [PATCH] Adapt tests --- .../Test/Golden/Governance/Action.hs | 20 +++++++++++++------ .../Test/Golden/Governance/Vote.hs | 2 +- .../view/create-constitution.action.view | 2 +- .../action/view/create-info.action.view | 2 +- .../view/create-no-confidence.action.view | 2 +- .../action/view/update-committee.action.view | 2 +- .../files/golden/governance/vote/vote | 2 +- .../files/golden/governance/vote/voteViewJSON | 2 +- .../files/golden/governance/vote/voteViewYAML | 2 +- 9 files changed, 22 insertions(+), 14 deletions(-) diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs index 50295c69a7..0226d7eb3a 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs @@ -26,11 +26,15 @@ hprop_golden_governance_action_create_constitution = actionFile <- noteTempFile tempDir "create-constitution.action" redactedActionFile <- noteTempFile tempDir "create-constitution.action.redacted" + proposalHash <- execCardanoCLI + [ "conway", "governance", "hash" + , "--text", "whatever "] + void $ execCardanoCLI [ "conway", "governance", "action", "create-constitution" , "--mainnet" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" - , "--proposal-anchor-url", "proposal-dummy-url" + , "--proposal-anchor-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" + , "--proposal-anchor-url", proposalHash , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile , "--out-file", actionFile @@ -52,10 +56,14 @@ hprop_golden_conway_governance_action_view_constitution_json = actionFile <- noteTempFile tempDir "action" + proposalHash <- execCardanoCLI + [ "conway", "governance", "hash" + , "--text", "whatever "] + void $ execCardanoCLI [ "conway", "governance", "action", "create-constitution" , "--mainnet" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--proposal-anchor-hash", proposalHash , "--proposal-anchor-url", "proposal-dummy-url" , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile @@ -84,7 +92,7 @@ hprop_golden_conway_governance_action_view_update_committee_yaml = , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile , "--proposal-anchor-url", "proposal-dummy-url" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--proposal-anchor-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" , "--quorum", "0.61" , "--out-file", actionFile ] @@ -110,7 +118,7 @@ hprop_golden_conway_governance_action_view_create_info_json_outfile = , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile , "--proposal-anchor-url", "proposal-dummy-url" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--proposal-anchor-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" , "--out-file", actionFile ] @@ -136,7 +144,7 @@ hprop_golden_governanceActionCreateNoConfidence = , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile , "--proposal-anchor-url", "proposal-dummy-url" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--proposal-anchor-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" , "--governance-action-index", "5" , "--governance-action-tx-id", "b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a" , "--out-file", actionFile diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs index a4ea9ce7f8..06424f216f 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs @@ -25,7 +25,7 @@ hprop_golden_governance_governance_vote_create = , "--drep-verification-key-file", vkeyFile , "--out-file", voteFile , "--vote-anchor-url", "https://example.com/vote" - , "--vote-anchor-metadata", "I don't like this proposal, because it's bad. I'm not going to tell you why I voted yes nonetheless." + , "--vote-anchor-hash", "6163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17" ] H.diffFileVsGoldenFile voteFile voteGold diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view index df2c2c4bed..0a21699f6f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view @@ -1,6 +1,6 @@ { "anchor": { - "dataHash": "04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784", + "dataHash": "2399719c6477ac0cd1348ef84d6752194280b10b58163593366f6e2ca9f28cd2", "url": "proposal-dummy-url" }, "deposit": 10, diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view index 287ddec4f2..6ffc55b5cd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view @@ -1,6 +1,6 @@ { "anchor": { - "dataHash": "04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784", + "dataHash": "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745", "url": "proposal-dummy-url" }, "deposit": 10, diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view index dfe2aedea2..5b5001d71c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view @@ -1,6 +1,6 @@ { "anchor": { - "dataHash": "04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784", + "dataHash": "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745", "url": "proposal-dummy-url" }, "deposit": 10, diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view index e8b331ebdc..cb2c2587bd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view @@ -1,5 +1,5 @@ anchor: - dataHash: 04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784 + dataHash: c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745 url: proposal-dummy-url deposit: 10 governance action: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote index 9cc83ddefa..de81fe3c92 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote @@ -1,5 +1,5 @@ { "type": "Governance voting procedures", "description": "", - "cborHex": "a18202581ceb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294da1825820b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a05820182781868747470733a2f2f6578616d706c652e636f6d2f766f746558206c4aa4dc17fc4d173f1c9a23c266acba6f942e7ae9f06103ea0ed1333b8d68de" + "cborHex": "a18202581ceb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294da1825820b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a05820182781868747470733a2f2f6578616d706c652e636f6d2f766f746558206163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17" } diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON index a3a88209e1..7735c831fc 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON @@ -2,7 +2,7 @@ "drep-keyHash-eb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294d": { "b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a#5": { "anchor": { - "dataHash": "6c4aa4dc17fc4d173f1c9a23c266acba6f942e7ae9f06103ea0ed1333b8d68de", + "dataHash": "6163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17", "url": "https://example.com/vote" }, "decision": "VoteYes" diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML index 9e0fc234a8..3333ddb8c8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML @@ -1,6 +1,6 @@ drep-keyHash-eb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294d: b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a#5: anchor: - dataHash: 6c4aa4dc17fc4d173f1c9a23c266acba6f942e7ae9f06103ea0ed1333b8d68de + dataHash: 6163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17 url: https://example.com/vote decision: VoteYes