-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'conway governance vote view' command
- Loading branch information
1 parent
2f6f50b
commit 25fd1bb
Showing
16 changed files
with
207 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{- HLINT ignore "Use camelCase" -} | ||
|
||
module Test.Golden.Governance.Vote where | ||
|
||
import Control.Monad (void) | ||
|
||
import Test.Cardano.CLI.Util (execCardanoCLI, noteInputFile, propertyOnce) | ||
|
||
import Hedgehog | ||
import qualified Hedgehog.Extras.Test.Base as H | ||
import qualified Hedgehog.Extras.Test.Golden as H | ||
|
||
hprop_golden_governance_governance_vote_create :: Property | ||
hprop_golden_governance_governance_vote_create = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
vkeyFile <- noteInputFile "test/cardano-cli-golden/files/input/drep.vkey" | ||
voteFile <- H.noteTempFile tempDir "vote" | ||
voteGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/vote" | ||
|
||
void $ execCardanoCLI | ||
[ "conway", "governance", "vote", "create" | ||
, "--yes" | ||
, "--governance-action-tx-id", "b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a" | ||
, "--governance-action-index", "5" | ||
, "--drep-verification-key-file", vkeyFile | ||
, "--out-file", voteFile | ||
] | ||
|
||
H.diffFileVsGoldenFile voteFile voteGold | ||
|
||
hprop_golden_governance_governance_vote_view_json_stdout :: Property | ||
hprop_golden_governance_governance_vote_view_json_stdout = | ||
propertyOnce $ do | ||
voteFile <- noteInputFile "test/cardano-cli-golden/files/golden/governance/vote/vote" | ||
voteViewGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON" | ||
voteView <- execCardanoCLI | ||
[ "conway", "governance", "vote", "view" | ||
, "--vote-file", voteFile | ||
] | ||
|
||
H.diffVsGoldenFile voteView voteViewGold | ||
|
||
hprop_golden_governance_governance_vote_view_json_outfile :: Property | ||
hprop_golden_governance_governance_vote_view_json_outfile = | ||
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do | ||
voteFile <- noteInputFile "test/cardano-cli-golden/files/golden/governance/vote/vote" | ||
voteViewFile <- H.noteTempFile tempDir "voteView" | ||
voteViewGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON" | ||
void $ execCardanoCLI | ||
[ "conway", "governance", "vote", "view" | ||
, "--vote-file", voteFile | ||
, "--out-file", voteViewFile | ||
] | ||
|
||
H.diffFileVsGoldenFile voteViewFile voteViewGold | ||
|
||
hprop_golden_governance_governance_vote_view_yaml :: Property | ||
hprop_golden_governance_governance_vote_view_yaml = | ||
propertyOnce $ do | ||
voteFile <- noteInputFile "test/cardano-cli-golden/files/golden/governance/vote/vote" | ||
voteViewGold <- H.note "test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML" | ||
voteView <- execCardanoCLI | ||
[ "conway", "governance", "vote", "view" | ||
, "--yaml" | ||
, "--vote-file", voteFile | ||
] | ||
|
||
H.diffVsGoldenFile voteView voteViewGold |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...rors.GovernanceVoteCmdError.GovernanceVoteCmdError/GovernanceVoteCmdReadVoteFileError.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Cannot read vote file: path/file.txt: TextEnvelope aeson decode error: some error description |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "Governance voting procedures", | ||
"description": "", | ||
"cborHex": "a18202581ceb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294da1825820b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a058201f6" | ||
} |
8 changes: 8 additions & 0 deletions
8
cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"drep-keyHash-eb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294d": { | ||
"b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a#5": { | ||
"anchor": null, | ||
"decision": "VoteYes" | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
drep-keyHash-eb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294d: | ||
b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a#5: | ||
anchor: null | ||
decision: VoteYes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_vote.cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Usage: cardano-cli conway governance vote (create | view) | ||
|
||
Vote commands. | ||
|
||
Available options: | ||
-h,--help Show this help text | ||
|
||
Available commands: | ||
create Vote creation. | ||
view Vote viewing. |
11 changes: 11 additions & 0 deletions
11
cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_vote_view.cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Usage: cardano-cli conway governance vote view [--yaml] | ||
--vote-file FILE | ||
[--out-file FILE] | ||
|
||
Vote viewing. | ||
|
||
Available options: | ||
--yaml Output vote in YAML format (and not JSON). | ||
--vote-file FILE Input filepath of the vote. | ||
--out-file FILE Optional output file. Default is to write to stdout. | ||
-h,--help Show this help text |