Skip to content

Commit

Permalink
Add test of voting using a cc hot key
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Oct 11, 2023
1 parent eb0e52b commit 7275c31
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
54 changes: 54 additions & 0 deletions cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,57 @@ hprop_golden_governance_governance_vote_view_yaml =
]

H.diffVsGoldenFile voteView voteViewGold

hprop_golden_governance_governance_vote_create_yes_cc_hot_key :: Property
hprop_golden_governance_governance_vote_create_yes_cc_hot_key =
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
ccVkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/cc.vkey"
voteFile <- H.noteTempFile tempDir "vote"
voteGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/vote_cc_yes.json"

void $ execCardanoCLI
[ "conway", "governance", "vote", "create"
, "--yes"
, "--governance-action-tx-id", "d21d997b5dbdd90180b642c3f4f2653cea629f6134cd9dc820d0fe6f11b54af4"
, "--governance-action-index", "0"
, "--cc-hot-verification-key-file", ccVkeyFile
, "--out-file", voteFile
]

H.diffFileVsGoldenFile voteFile voteGold

hprop_golden_governance_governance_vote_create_no_cc_hot_key :: Property
hprop_golden_governance_governance_vote_create_no_cc_hot_key =
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
ccVkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/cc.vkey"
voteFile <- H.noteTempFile tempDir "vote"
voteGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/vote_cc_no.json"

void $ execCardanoCLI
[ "conway", "governance", "vote", "create"
, "--no"
, "--governance-action-tx-id", "d21d997b5dbdd90180b642c3f4f2653cea629f6134cd9dc820d0fe6f11b54af4"
, "--governance-action-index", "0"
, "--cc-hot-verification-key-file", ccVkeyFile
, "--out-file", voteFile
]

H.diffFileVsGoldenFile voteFile voteGold

hprop_golden_governance_governance_vote_create_abstain_cc_hot_key :: Property
hprop_golden_governance_governance_vote_create_abstain_cc_hot_key =
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
ccVkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/cc.vkey"
voteFile <- H.noteTempFile tempDir "vote"
voteGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/vote_cc_abstain.json"

void $ execCardanoCLI
[ "conway", "governance", "vote", "create"
, "--abstain"
, "--governance-action-tx-id", "d21d997b5dbdd90180b642c3f4f2653cea629f6134cd9dc820d0fe6f11b54af4"
, "--governance-action-index", "0"
, "--cc-hot-verification-key-file", ccVkeyFile
, "--out-file", voteFile
]

H.diffFileVsGoldenFile voteFile voteGold
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "Governance voting procedures",
"description": "",
"cborHex": "a18200581c96ded47e88ee07c28ec3c2bf5ea156e37e544ff5beb5348d3c653282a1825820d21d997b5dbdd90180b642c3f4f2653cea629f6134cd9dc820d0fe6f11b54af4008202f6"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "Governance voting procedures",
"description": "",
"cborHex": "a18200581c96ded47e88ee07c28ec3c2bf5ea156e37e544ff5beb5348d3c653282a1825820d21d997b5dbdd90180b642c3f4f2653cea629f6134cd9dc820d0fe6f11b54af4008200f6"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "Governance voting procedures",
"description": "",
"cborHex": "a18200581c96ded47e88ee07c28ec3c2bf5ea156e37e544ff5beb5348d3c653282a1825820d21d997b5dbdd90180b642c3f4f2653cea629f6134cd9dc820d0fe6f11b54af4008201f6"
}
5 changes: 5 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/input/cc.vkey
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "ConstitutionalCommitteeHotVerificationKey_ed25519",
"description": "Constitutional Committee Hot Verification Key",
"cborHex": "5820b604f364de66ede115fb24d7b301042effd43133405d5f2e2646f7cad426b8b7"
}

0 comments on commit 7275c31

Please sign in to comment.