-
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.
Merge pull request #787 from IntersectMBO/smelc/remove-governance-in-…
…conway-governance-hash Move "conway governance hash" commands to "hash"
- Loading branch information
Showing
48 changed files
with
355 additions
and
378 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE DuplicateRecordFields #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
|
||
module Cardano.CLI.Commands.Hash | ||
( HashCmds (..) | ||
, HashAnchorDataCmdArgs (..) | ||
, HashScriptCmdArgs (..) | ||
, AnchorDataHashSource (..) | ||
, renderHashCmds | ||
) where | ||
|
||
import Cardano.Api | ||
|
||
import Cardano.CLI.Types.Common | ||
|
||
import Data.Text (Text) | ||
|
||
data HashCmds | ||
= HashAnchorDataCmd !HashAnchorDataCmdArgs | ||
| HashScriptCmd !HashScriptCmdArgs | ||
|
||
data HashAnchorDataCmdArgs | ||
= HashAnchorDataCmdArgs { | ||
toHash :: !AnchorDataHashSource | ||
, mOutFile :: !(Maybe (File () Out)) -- ^ The output file to which the hash is written | ||
} deriving Show | ||
|
||
data AnchorDataHashSource | ||
= AnchorDataHashSourceBinaryFile (File ProposalBinary In) | ||
| AnchorDataHashSourceTextFile (File ProposalText In) | ||
| AnchorDataHashSourceText Text | ||
deriving Show | ||
|
||
data HashScriptCmdArgs | ||
= HashScriptCmdArgs { | ||
toHash :: !ScriptFile | ||
, mOutFile :: !(Maybe (File () Out)) -- ^ The output file to which the hash is written | ||
} deriving Show | ||
|
||
renderHashCmds :: HashCmds -> Text | ||
renderHashCmds = \case | ||
HashAnchorDataCmd {} -> "hash anchor-data" | ||
HashScriptCmd {} -> "hash script" |
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
47 changes: 0 additions & 47 deletions
47
cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs
This file was deleted.
Oops, something went wrong.
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
76 changes: 0 additions & 76 deletions
76
cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Hash.hs
This file was deleted.
Oops, something went wrong.
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.