-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #442 from input-output-hk/smelc/governance-rework-…
…hash-arguments governance: add hash command and remove text/file hash arguments of existing commands
- Loading branch information
Showing
42 changed files
with
390 additions
and
285 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
35 changes: 35 additions & 0 deletions
35
cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.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,35 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
|
||
|
||
module Cardano.CLI.EraBased.Commands.Governance.Hash | ||
( | ||
GovernanceHashCmds (..), | ||
GovernanceHashCmdArgs (..), | ||
GovernanceHashSource (..), | ||
renderGovernanceHashCmds | ||
) where | ||
|
||
import Cardano.Api | ||
|
||
import Cardano.CLI.Types.Common | ||
|
||
import Data.Text (Text) | ||
|
||
newtype GovernanceHashCmds era = GovernanceHashCmd (GovernanceHashCmdArgs era) | ||
|
||
data GovernanceHashCmdArgs era | ||
= GovernanceHashCmdArgs { | ||
eon :: !(ConwayEraOnwards era), | ||
toHash :: !GovernanceHashSource | ||
} deriving Show | ||
|
||
data GovernanceHashSource | ||
= GovernanceHashSourceBinaryFile (File ProposalText In) | ||
| GovernanceHashSourceTextFile (File ProposalText In) | ||
| GovernanceHashSourceText Text | ||
deriving Show | ||
|
||
renderGovernanceHashCmds :: GovernanceHashCmds era -> Text | ||
renderGovernanceHashCmds = | ||
\case GovernanceHashCmd {} -> "governance hash" |
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
Oops, something went wrong.