From 5d29eb2fe413b40b323956a1ccddfd5a21bd57d9 Mon Sep 17 00:00:00 2001 From: John Ky Date: Tue, 29 Aug 2023 20:18:03 +1000 Subject: [PATCH 1/2] Consolidate legacy governance commands --- cardano-cli/cardano-cli.cabal | 1 - .../src/Cardano/CLI/Commands/Governance.hs | 119 ------------------ .../src/Cardano/CLI/Legacy/Run/Governance.hs | 105 +++++++++++++++- .../Test/Golden/ErrorsSpec.hs | 2 +- 4 files changed, 102 insertions(+), 125 deletions(-) delete mode 100644 cardano-cli/src/Cardano/CLI/Commands/Governance.hs diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 5b7c78f3e0..5fdd0099c8 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -64,7 +64,6 @@ library Cardano.CLI.Byron.Tx Cardano.CLI.Byron.UpdateProposal Cardano.CLI.Byron.Vote - Cardano.CLI.Commands.Governance Cardano.CLI.Environment Cardano.CLI.EraBased.Commands Cardano.CLI.EraBased.Commands.Governance diff --git a/cardano-cli/src/Cardano/CLI/Commands/Governance.hs b/cardano-cli/src/Cardano/CLI/Commands/Governance.hs deleted file mode 100644 index 06aefe0fdd..0000000000 --- a/cardano-cli/src/Cardano/CLI/Commands/Governance.hs +++ /dev/null @@ -1,119 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} - -module Cardano.CLI.Commands.Governance where - -import Cardano.Api -import qualified Cardano.Api.Ledger as Ledger -import Cardano.Api.Shelley - -import Cardano.CLI.Types.Common -import Cardano.CLI.Types.Errors.GovernanceCmdError -import Cardano.CLI.Types.Governance -import Cardano.CLI.Types.Key - -import Control.Monad.IO.Class -import Control.Monad.Trans.Except (ExceptT) -import Control.Monad.Trans.Except.Extra (firstExceptT, hoistEither, newExceptT) -import Data.Bifunctor -import qualified Data.ByteString as BS -import Data.Text (Text) -import qualified Data.Text.Encoding as Text -import Data.Word - -runGovernanceCreateVoteCmd :: () - => AnyShelleyBasedEra - -> Vote - -> VType - -> (TxId, Word32) - -> VerificationKeyOrFile StakePoolKey - -> VoteFile Out - -> ExceptT GovernanceCmdError IO () -runGovernanceCreateVoteCmd anyEra vChoice vType (govActionTxId, govActionIndex) votingStakeCred oFp = do - AnyShelleyBasedEra sbe <- pure anyEra - - shelleyBasedEraConstraints sbe $ do - vStakePoolKey <- firstExceptT ReadFileError . newExceptT $ readVerificationKeyOrFile AsStakePoolKey votingStakeCred - let stakePoolKeyHash = verificationKeyHash vStakePoolKey - vStakeCred = StakeCredentialByKey . (verificationKeyHash . castVerificationKey) $ vStakePoolKey - case vType of - VCC -> do - votingCred <- hoistEither $ first VotingCredentialDecodeGovCmdEror $ toVotingCredential sbe vStakeCred - let voter = Ledger.CommitteeVoter (Ledger.coerceKeyRole (unVotingCredential votingCred)) -- TODO Conway - remove coerceKeyRole - govActIdentifier = createGovernanceActionId govActionTxId govActionIndex - voteProcedure = createVotingProcedure sbe vChoice Nothing - votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) - firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures - - VDR -> do - votingCred <- hoistEither $ first VotingCredentialDecodeGovCmdEror $ toVotingCredential sbe vStakeCred - let voter = Ledger.DRepVoter (unVotingCredential votingCred) - govActIdentifier = createGovernanceActionId govActionTxId govActionIndex - voteProcedure = createVotingProcedure sbe vChoice Nothing - votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) - firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures - - VSP -> do - let voter = Ledger.StakePoolVoter (unStakePoolKeyHash stakePoolKeyHash) - govActIdentifier = createGovernanceActionId govActionTxId govActionIndex - voteProcedure = createVotingProcedure sbe vChoice Nothing - votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) - firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures - - -runGovernanceNewConstitutionCmd - :: Ledger.Network - -> AnyShelleyBasedEra - -> Lovelace - -> VerificationKeyOrFile StakePoolKey - -> Maybe (TxId, Word32) - -> (Ledger.Url, Text) - -> Constitution - -> NewConstitutionFile Out - -> ExceptT GovernanceCmdError IO () -runGovernanceNewConstitutionCmd network sbe deposit stakeVoteCred mPrevGovAct propAnchor constitution oFp = do - vStakePoolKeyHash - <- fmap (verificationKeyHash . castVerificationKey) - <$> firstExceptT ReadFileError . newExceptT - $ readVerificationKeyOrFile AsStakePoolKey stakeVoteCred - case constitution of - ConstitutionFromFile url fp -> do - cBs <- liftIO $ BS.readFile $ unFile fp - _utf8EncodedText <- firstExceptT NonUtf8EncodedConstitution . hoistEither $ Text.decodeUtf8' cBs - let prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovAct - govAct = ProposeNewConstitution - prevGovActId - (createAnchor url cBs) -- TODO: Conway era - this is wrong, create `AnchorData` then hash that with hashAnchorData - runGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp - - ConstitutionFromText url c -> do - let constitBs = Text.encodeUtf8 c - prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovAct - govAct = ProposeNewConstitution - prevGovActId - (createAnchor url constitBs) - runGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp - -runGovernanceCreateActionCmd - :: Ledger.Network - -> AnyShelleyBasedEra - -> Lovelace - -> Hash StakeKey - -> (Ledger.Url, Text) - -> GovernanceAction - -> File a Out - -> ExceptT GovernanceCmdError IO () -runGovernanceCreateActionCmd network anyEra deposit depositReturnAddr propAnchor govAction oFp = do - AnyShelleyBasedEra sbe <- pure anyEra - let proposal = createProposalProcedure - sbe - network - deposit - depositReturnAddr - govAction - (uncurry createAnchor (fmap Text.encodeUtf8 propAnchor)) - - firstExceptT WriteFileError . newExceptT - $ shelleyBasedEraConstraints sbe - $ writeFileTextEnvelope oFp Nothing proposal - diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs index 8a0a8b7f43..56582dd9e0 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs @@ -9,10 +9,10 @@ module Cardano.CLI.Legacy.Run.Governance ) where import Cardano.Api +import qualified Cardano.Api.Ledger as Ledger import Cardano.Api.Shelley import qualified Cardano.Api.Shelley as Api -import Cardano.CLI.Commands.Governance import Cardano.CLI.EraBased.Run.Governance import Cardano.CLI.Legacy.Commands.Governance import Cardano.CLI.Read (fileOrPipe, readFileTx) @@ -20,15 +20,16 @@ import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.GovernanceCmdError import Cardano.CLI.Types.Governance import qualified Cardano.CLI.Types.Governance as Cli -import Cardano.CLI.Types.Key (VerificationKeyOrHashOrFile, - readVerificationKeyOrHashOrFile, readVerificationKeyOrHashOrTextEnvFile) +import Cardano.CLI.Types.Key import Control.Monad -import Control.Monad.IO.Class (liftIO) +import Control.Monad.IO.Class import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.Except.Extra import Data.Aeson (eitherDecode) +import Data.Bifunctor +import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BSC import qualified Data.ByteString.Lazy as LB import Data.Function ((&)) @@ -38,6 +39,7 @@ import qualified Data.Text as Text import qualified Data.Text.Encoding as Text import qualified Data.Text.IO as Text import qualified Data.Text.Read as Text +import Data.Word import qualified System.IO as IO import System.IO (stderr, stdin, stdout) @@ -62,6 +64,101 @@ runGovernanceCmds = \case GovernanceVerifyPoll poll metadata mOutFile -> runGovernanceVerifyPoll poll metadata mOutFile +runGovernanceCreateVoteCmd :: () + => AnyShelleyBasedEra + -> Vote + -> VType + -> (TxId, Word32) + -> VerificationKeyOrFile StakePoolKey + -> VoteFile Out + -> ExceptT GovernanceCmdError IO () +runGovernanceCreateVoteCmd anyEra vChoice vType (govActionTxId, govActionIndex) votingStakeCred oFp = do + AnyShelleyBasedEra sbe <- pure anyEra + + shelleyBasedEraConstraints sbe $ do + vStakePoolKey <- firstExceptT ReadFileError . newExceptT $ readVerificationKeyOrFile AsStakePoolKey votingStakeCred + let stakePoolKeyHash = verificationKeyHash vStakePoolKey + vStakeCred = StakeCredentialByKey . (verificationKeyHash . castVerificationKey) $ vStakePoolKey + case vType of + VCC -> do + votingCred <- hoistEither $ first VotingCredentialDecodeGovCmdEror $ toVotingCredential sbe vStakeCred + let voter = Ledger.CommitteeVoter (Ledger.coerceKeyRole (unVotingCredential votingCred)) -- TODO Conway - remove coerceKeyRole + govActIdentifier = createGovernanceActionId govActionTxId govActionIndex + voteProcedure = createVotingProcedure sbe vChoice Nothing + votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) + firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures + + VDR -> do + votingCred <- hoistEither $ first VotingCredentialDecodeGovCmdEror $ toVotingCredential sbe vStakeCred + let voter = Ledger.DRepVoter (unVotingCredential votingCred) + govActIdentifier = createGovernanceActionId govActionTxId govActionIndex + voteProcedure = createVotingProcedure sbe vChoice Nothing + votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) + firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures + + VSP -> do + let voter = Ledger.StakePoolVoter (unStakePoolKeyHash stakePoolKeyHash) + govActIdentifier = createGovernanceActionId govActionTxId govActionIndex + voteProcedure = createVotingProcedure sbe vChoice Nothing + votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) + firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures + +runGovernanceNewConstitutionCmd + :: Ledger.Network + -> AnyShelleyBasedEra + -> Lovelace + -> VerificationKeyOrFile StakePoolKey + -> Maybe (TxId, Word32) + -> (Ledger.Url, Text) + -> Constitution + -> NewConstitutionFile Out + -> ExceptT GovernanceCmdError IO () +runGovernanceNewConstitutionCmd network sbe deposit stakeVoteCred mPrevGovAct propAnchor constitution oFp = do + vStakePoolKeyHash + <- fmap (verificationKeyHash . castVerificationKey) + <$> firstExceptT ReadFileError . newExceptT + $ readVerificationKeyOrFile AsStakePoolKey stakeVoteCred + case constitution of + ConstitutionFromFile url fp -> do + cBs <- liftIO $ BS.readFile $ unFile fp + _utf8EncodedText <- firstExceptT NonUtf8EncodedConstitution . hoistEither $ Text.decodeUtf8' cBs + let prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovAct + govAct = ProposeNewConstitution + prevGovActId + (createAnchor url cBs) -- TODO: Conway era - this is wrong, create `AnchorData` then hash that with hashAnchorData + runGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp + + ConstitutionFromText url c -> do + let constitBs = Text.encodeUtf8 c + prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovAct + govAct = ProposeNewConstitution + prevGovActId + (createAnchor url constitBs) + runGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp + +runGovernanceCreateActionCmd + :: Ledger.Network + -> AnyShelleyBasedEra + -> Lovelace + -> Hash StakeKey + -> (Ledger.Url, Text) + -> GovernanceAction + -> File a Out + -> ExceptT GovernanceCmdError IO () +runGovernanceCreateActionCmd network anyEra deposit depositReturnAddr propAnchor govAction oFp = do + AnyShelleyBasedEra sbe <- pure anyEra + let proposal = createProposalProcedure + sbe + network + deposit + depositReturnAddr + govAction + (uncurry createAnchor (fmap Text.encodeUtf8 propAnchor)) + + firstExceptT WriteFileError . newExceptT + $ shelleyBasedEraConstraints sbe + $ writeFileTextEnvelope oFp Nothing proposal + runGovernanceGenesisKeyDelegationCertificate :: AnyShelleyBasedEra -> VerificationKeyOrHashOrFile GenesisKey diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/ErrorsSpec.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/ErrorsSpec.hs index e379dff700..c5b09db82f 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/ErrorsSpec.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/ErrorsSpec.hs @@ -32,7 +32,7 @@ import Test.Tasty test_GovernanceCmdError :: TestTree test_GovernanceCmdError = - testErrorMessagesRendering "Cardano.CLI.Commands.Governance" "GovernanceCmdError" + testErrorMessagesRendering "Cardano.CLI.Types.Errors.GovernanceCmdError" "GovernanceCmdError" [ ("StakeCredGovCmdError" , StakeCredGovCmdError . ShelleyStakeAddressCmdReadKeyFileError From 9734826f0a58c7c661a1f86ab5bea1d7f6f34c8f Mon Sep 17 00:00:00 2001 From: John Ky Date: Tue, 29 Aug 2023 20:35:11 +1000 Subject: [PATCH 2/2] Add legacy prefix to legacy governance commands and delegate to era-based commands where appropriate --- cardano-cli/src/Cardano/CLI/Legacy/Run.hs | 2 +- .../src/Cardano/CLI/Legacy/Run/Governance.hs | 83 ++++++++++++------- .../EraBasedVoteReadError.txt | 1 - .../EraBasedVoteWriteError.txt | 1 - .../EraBasedVotingCredentialDecodeError.txt | 2 - .../GovernanceCmdCddlError.txt | 0 .../GovernanceCmdCostModelReadError.txt | 0 .../GovernanceCmdCostModelsJsonDecodeErr.txt | 0 .../GovernanceCmdDecoderError.txt | 0 .../GovernanceCmdEmptyCostModel.txt | 0 .../GovernanceCmdEmptyUpdateProposalError.txt | 0 ...dGenesisDelegationNotSupportedInConway.txt | 0 .../GovernanceCmdKeyReadError.txt | 0 ...vernanceCmdMIRCertNotSupportedInConway.txt | 0 ...anceCmdMIRCertificateKeyRewardMistmach.txt | 0 .../GovernanceCmdPollInvalidChoice.txt | 0 .../GovernanceCmdPollOutOfBoundAnswer.txt | 0 .../GovernanceCmdTextEnvReadError.txt | 0 .../GovernanceCmdTextEnvWriteError.txt | 0 .../GovernanceCmdUnexpectedKeyType.txt | 0 .../GovernanceCmdVerifyPollError.txt | 0 .../GovernanceCmdWriteFileError.txt | 0 .../NonUtf8EncodedConstitution.txt | 0 .../ReadFileError.txt | 0 .../StakeCredGovCmdError.txt | 0 .../VotingCredentialDecodeGovCmdEror.txt | 0 .../WriteFileError.txt | 0 .../GovernanceVoteCmeWriteError.txt | 1 - 28 files changed, 52 insertions(+), 38 deletions(-) delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteReadError.txt delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteWriteError.txt delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVotingCredentialDecodeError.txt rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdCddlError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdCostModelReadError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdCostModelsJsonDecodeErr.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdDecoderError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdEmptyCostModel.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdEmptyUpdateProposalError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdGenesisDelegationNotSupportedInConway.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdKeyReadError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdMIRCertNotSupportedInConway.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdMIRCertificateKeyRewardMistmach.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdPollInvalidChoice.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdPollOutOfBoundAnswer.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdTextEnvReadError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdTextEnvWriteError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdUnexpectedKeyType.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdVerifyPollError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/GovernanceCmdWriteFileError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/NonUtf8EncodedConstitution.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/ReadFileError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/StakeCredGovCmdError.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/VotingCredentialDecodeGovCmdEror.txt (100%) rename cardano-cli/test/cardano-cli-golden/files/golden/errors/{Cardano.CLI.Commands.Governance.GovernanceCmdError => Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError}/WriteFileError.txt (100%) delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceVoteCmdError.GovernanceVoteCmdError/GovernanceVoteCmeWriteError.txt diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run.hs index 7b4865b83d..16a27ff86d 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run.hs @@ -24,7 +24,7 @@ runLegacyCmds :: LegacyCmds -> ExceptT CmdError IO () runLegacyCmds = \case LegacyAddressCmds cmd -> firstExceptT CmdAddressError $ runAddressCmds cmd LegacyGenesisCmds cmd -> firstExceptT CmdGenesisError $ runGenesisCmds cmd - LegacyGovernanceCmds cmd -> firstExceptT CmdGovernanceCmdError $ runGovernanceCmds cmd + LegacyGovernanceCmds cmd -> firstExceptT CmdGovernanceCmdError $ runLegacyGovernanceCmds cmd LegacyKeyCmds cmd -> firstExceptT CmdKeyError $ runKeyCmds cmd LegacyNodeCmds cmd -> firstExceptT CmdNodeError $ runNodeCmds cmd LegacyPoolCmds cmd -> firstExceptT CmdPoolError $ runPoolCmds cmd diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs index 56582dd9e0..0ff9316c9a 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Governance.hs @@ -5,7 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} module Cardano.CLI.Legacy.Run.Governance - ( runGovernanceCmds + ( runLegacyGovernanceCmds ) where import Cardano.Api @@ -43,28 +43,28 @@ import Data.Word import qualified System.IO as IO import System.IO (stderr, stdin, stdout) -runGovernanceCmds :: LegacyGovernanceCmds -> ExceptT GovernanceCmdError IO () -runGovernanceCmds = \case +runLegacyGovernanceCmds :: LegacyGovernanceCmds -> ExceptT GovernanceCmdError IO () +runLegacyGovernanceCmds = \case GovernanceVoteCmd (CreateVoteCmd (ConwayVote voteChoice voteType govActTcIn voteStakeCred sbe fp)) -> - runGovernanceCreateVoteCmd sbe voteChoice voteType govActTcIn voteStakeCred fp + runLegacyGovernanceCreateVoteCmd sbe voteChoice voteType govActTcIn voteStakeCred fp GovernanceActionCmd (CreateConstitution (Cli.NewConstitution network sbe deposit voteStakeCred mPrevGovActId propAnchor newconstitution fp)) -> - runGovernanceNewConstitutionCmd network sbe deposit voteStakeCred mPrevGovActId propAnchor newconstitution fp - GovernanceMIRPayStakeAddressesCertificate (AnyShelleyToBabbageEra w) mirpot vKeys rewards out -> - runGovernanceMIRCertificatePayStakeAddrs w mirpot vKeys rewards out - GovernanceMIRTransfer (AnyShelleyToBabbageEra w) amt out direction -> do - runGovernanceMIRCertificateTransfer w amt out direction + runLegacyGovernanceNewConstitutionCmd network sbe deposit voteStakeCred mPrevGovActId propAnchor newconstitution fp + GovernanceMIRPayStakeAddressesCertificate anyEra mirpot vKeys rewards out -> + runLegacyGovernanceMIRCertificatePayStakeAddrs anyEra mirpot vKeys rewards out + GovernanceMIRTransfer anyEra amt out direction -> do + runLegacyGovernanceMIRCertificateTransfer anyEra amt out direction GovernanceGenesisKeyDelegationCertificate sbe genVk genDelegVk vrfVk out -> - runGovernanceGenesisKeyDelegationCertificate sbe genVk genDelegVk vrfVk out + runLegacyGovernanceGenesisKeyDelegationCertificate sbe genVk genDelegVk vrfVk out GovernanceUpdateProposal out eNo genVKeys ppUp mCostModelFp -> - runGovernanceUpdateProposal out eNo genVKeys ppUp mCostModelFp + runLegacyGovernanceUpdateProposal out eNo genVKeys ppUp mCostModelFp GovernanceCreatePoll prompt choices nonce out -> - runGovernanceCreatePoll prompt choices nonce out + runLegacyGovernanceCreatePoll prompt choices nonce out GovernanceAnswerPoll poll ix mOutFile -> - runGovernanceAnswerPoll poll ix mOutFile + runLegacyGovernanceAnswerPoll poll ix mOutFile GovernanceVerifyPoll poll metadata mOutFile -> - runGovernanceVerifyPoll poll metadata mOutFile + runLegacyGovernanceVerifyPoll poll metadata mOutFile -runGovernanceCreateVoteCmd :: () +runLegacyGovernanceCreateVoteCmd :: () => AnyShelleyBasedEra -> Vote -> VType @@ -72,7 +72,7 @@ runGovernanceCreateVoteCmd :: () -> VerificationKeyOrFile StakePoolKey -> VoteFile Out -> ExceptT GovernanceCmdError IO () -runGovernanceCreateVoteCmd anyEra vChoice vType (govActionTxId, govActionIndex) votingStakeCred oFp = do +runLegacyGovernanceCreateVoteCmd anyEra vChoice vType (govActionTxId, govActionIndex) votingStakeCred oFp = do AnyShelleyBasedEra sbe <- pure anyEra shelleyBasedEraConstraints sbe $ do @@ -103,7 +103,7 @@ runGovernanceCreateVoteCmd anyEra vChoice vType (govActionTxId, govActionIndex) votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) firstExceptT WriteFileError . newExceptT $ writeFileTextEnvelope oFp Nothing votingProcedures -runGovernanceNewConstitutionCmd +runLegacyGovernanceNewConstitutionCmd :: Ledger.Network -> AnyShelleyBasedEra -> Lovelace @@ -113,7 +113,7 @@ runGovernanceNewConstitutionCmd -> Constitution -> NewConstitutionFile Out -> ExceptT GovernanceCmdError IO () -runGovernanceNewConstitutionCmd network sbe deposit stakeVoteCred mPrevGovAct propAnchor constitution oFp = do +runLegacyGovernanceNewConstitutionCmd network sbe deposit stakeVoteCred mPrevGovAct propAnchor constitution oFp = do vStakePoolKeyHash <- fmap (verificationKeyHash . castVerificationKey) <$> firstExceptT ReadFileError . newExceptT @@ -126,7 +126,7 @@ runGovernanceNewConstitutionCmd network sbe deposit stakeVoteCred mPrevGovAct pr govAct = ProposeNewConstitution prevGovActId (createAnchor url cBs) -- TODO: Conway era - this is wrong, create `AnchorData` then hash that with hashAnchorData - runGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp + runLegacyGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp ConstitutionFromText url c -> do let constitBs = Text.encodeUtf8 c @@ -134,9 +134,28 @@ runGovernanceNewConstitutionCmd network sbe deposit stakeVoteCred mPrevGovAct pr govAct = ProposeNewConstitution prevGovActId (createAnchor url constitBs) - runGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp + runLegacyGovernanceCreateActionCmd network sbe deposit vStakePoolKeyHash propAnchor govAct oFp -runGovernanceCreateActionCmd +runLegacyGovernanceMIRCertificatePayStakeAddrs + :: AnyShelleyToBabbageEra + -> Ledger.MIRPot + -> [StakeAddress] -- ^ Stake addresses + -> [Lovelace] -- ^ Corresponding reward amounts (same length) + -> File () Out + -> ExceptT GovernanceCmdError IO () +runLegacyGovernanceMIRCertificatePayStakeAddrs (AnyShelleyToBabbageEra w) = + runGovernanceMIRCertificatePayStakeAddrs w + +runLegacyGovernanceMIRCertificateTransfer + :: AnyShelleyToBabbageEra + -> Lovelace + -> File () Out + -> TransferDirection + -> ExceptT GovernanceCmdError IO () +runLegacyGovernanceMIRCertificateTransfer (AnyShelleyToBabbageEra w) = + runGovernanceMIRCertificateTransfer w + +runLegacyGovernanceCreateActionCmd :: Ledger.Network -> AnyShelleyBasedEra -> Lovelace @@ -145,7 +164,7 @@ runGovernanceCreateActionCmd -> GovernanceAction -> File a Out -> ExceptT GovernanceCmdError IO () -runGovernanceCreateActionCmd network anyEra deposit depositReturnAddr propAnchor govAction oFp = do +runLegacyGovernanceCreateActionCmd network anyEra deposit depositReturnAddr propAnchor govAction oFp = do AnyShelleyBasedEra sbe <- pure anyEra let proposal = createProposalProcedure sbe @@ -159,14 +178,14 @@ runGovernanceCreateActionCmd network anyEra deposit depositReturnAddr propAnchor $ shelleyBasedEraConstraints sbe $ writeFileTextEnvelope oFp Nothing proposal -runGovernanceGenesisKeyDelegationCertificate +runLegacyGovernanceGenesisKeyDelegationCertificate :: AnyShelleyBasedEra -> VerificationKeyOrHashOrFile GenesisKey -> VerificationKeyOrHashOrFile GenesisDelegateKey -> VerificationKeyOrHashOrFile VrfKey -> File () Out -> ExceptT GovernanceCmdError IO () -runGovernanceGenesisKeyDelegationCertificate (AnyShelleyBasedEra sbe) +runLegacyGovernanceGenesisKeyDelegationCertificate (AnyShelleyBasedEra sbe) genVkOrHashOrFp genDelVkOrHashOrFp vrfVkOrHashOrFp @@ -213,7 +232,7 @@ createGenesisDelegationRequirements sbe hGen hGenDeleg hVrf = ShelleyBasedEraConway -> Left GovernanceCmdGenesisDelegationNotSupportedInConway -runGovernanceUpdateProposal +runLegacyGovernanceUpdateProposal :: File () Out -> EpochNo -> [VerificationKeyFile In] @@ -221,7 +240,7 @@ runGovernanceUpdateProposal -> ProtocolParametersUpdate -> Maybe FilePath -- ^ Cost models file path -> ExceptT GovernanceCmdError IO () -runGovernanceUpdateProposal upFile eNo genVerKeyFiles upPprams mCostModelFp = do +runLegacyGovernanceUpdateProposal upFile eNo genVerKeyFiles upPprams mCostModelFp = do finalUpPprams <- case mCostModelFp of Nothing -> return upPprams Just fp -> do @@ -248,13 +267,13 @@ runGovernanceUpdateProposal upFile eNo genVerKeyFiles upPprams mCostModelFp = do firstExceptT GovernanceCmdTextEnvWriteError . newExceptT $ writeLazyByteStringFile upFile $ textEnvelopeToJSON Nothing upProp -runGovernanceCreatePoll +runLegacyGovernanceCreatePoll :: Text -> [Text] -> Maybe Word -> File GovernancePoll Out -> ExceptT GovernanceCmdError IO () -runGovernanceCreatePoll govPollQuestion govPollAnswers govPollNonce out = do +runLegacyGovernanceCreatePoll govPollQuestion govPollAnswers govPollNonce out = do let poll = GovernancePoll{ govPollQuestion, govPollAnswers, govPollNonce } let description = fromString $ "An on-chain poll for SPOs: " <> Text.unpack govPollQuestion @@ -282,12 +301,12 @@ runGovernanceCreatePoll govPollQuestion govPollAnswers govPollNonce out = do , "participants has been generated at '" <> outPath <> "'." ] -runGovernanceAnswerPoll +runLegacyGovernanceAnswerPoll :: File GovernancePoll In -> Maybe Word -- ^ Answer index -> Maybe (File () Out) -- ^ Output file -> ExceptT GovernanceCmdError IO () -runGovernanceAnswerPoll pollFile maybeChoice mOutFile = do +runLegacyGovernanceAnswerPoll pollFile maybeChoice mOutFile = do poll <- firstExceptT GovernanceCmdTextEnvReadError . newExceptT $ readFileTextEnvelope AsGovernancePoll pollFile @@ -352,12 +371,12 @@ runGovernanceAnswerPoll pollFile maybeChoice mOutFile = do _ -> left GovernanceCmdPollInvalidChoice -runGovernanceVerifyPoll +runLegacyGovernanceVerifyPoll :: File GovernancePoll In -> File (Api.Tx ()) In -> Maybe (File () Out) -- ^ Output file -> ExceptT GovernanceCmdError IO () -runGovernanceVerifyPoll pollFile txFile mOutFile = do +runLegacyGovernanceVerifyPoll pollFile txFile mOutFile = do poll <- firstExceptT GovernanceCmdTextEnvReadError . newExceptT $ readFileTextEnvelope AsGovernancePoll pollFile diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteReadError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteReadError.txt deleted file mode 100644 index c181b05731..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteReadError.txt +++ /dev/null @@ -1 +0,0 @@ -Cannot read verification key: path/file.txt: Invalid key. \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteWriteError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteWriteError.txt deleted file mode 100644 index ba12b65dde..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVoteWriteError.txt +++ /dev/null @@ -1 +0,0 @@ -Cannot write vote: path/file.txt: \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVotingCredentialDecodeError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVotingCredentialDecodeError.txt deleted file mode 100644 index 3ccf4dfe3f..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.EraBased.Vote.EraBasedVoteError/EraBasedVotingCredentialDecodeError.txt +++ /dev/null @@ -1,2 +0,0 @@ -Cannot decode voting credential: An error occured while decoding . -Error: \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdCddlError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdCddlError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdCddlError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdCddlError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdCostModelReadError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdCostModelReadError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdCostModelReadError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdCostModelReadError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdCostModelsJsonDecodeErr.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdCostModelsJsonDecodeErr.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdCostModelsJsonDecodeErr.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdCostModelsJsonDecodeErr.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdDecoderError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdDecoderError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdDecoderError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdDecoderError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdEmptyCostModel.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdEmptyCostModel.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdEmptyCostModel.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdEmptyCostModel.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdEmptyUpdateProposalError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdEmptyUpdateProposalError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdEmptyUpdateProposalError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdEmptyUpdateProposalError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdGenesisDelegationNotSupportedInConway.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdGenesisDelegationNotSupportedInConway.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdGenesisDelegationNotSupportedInConway.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdGenesisDelegationNotSupportedInConway.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdKeyReadError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdKeyReadError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdKeyReadError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdKeyReadError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdMIRCertNotSupportedInConway.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdMIRCertNotSupportedInConway.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdMIRCertNotSupportedInConway.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdMIRCertNotSupportedInConway.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdMIRCertificateKeyRewardMistmach.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdMIRCertificateKeyRewardMistmach.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdMIRCertificateKeyRewardMistmach.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdMIRCertificateKeyRewardMistmach.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdPollInvalidChoice.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdPollInvalidChoice.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdPollInvalidChoice.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdPollInvalidChoice.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdPollOutOfBoundAnswer.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdPollOutOfBoundAnswer.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdPollOutOfBoundAnswer.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdPollOutOfBoundAnswer.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdTextEnvReadError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdTextEnvReadError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdTextEnvReadError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdTextEnvReadError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdTextEnvWriteError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdTextEnvWriteError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdTextEnvWriteError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdTextEnvWriteError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdUnexpectedKeyType.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdUnexpectedKeyType.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdUnexpectedKeyType.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdUnexpectedKeyType.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdVerifyPollError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdVerifyPollError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdVerifyPollError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdVerifyPollError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdWriteFileError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdWriteFileError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/GovernanceCmdWriteFileError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/GovernanceCmdWriteFileError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/NonUtf8EncodedConstitution.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/NonUtf8EncodedConstitution.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/NonUtf8EncodedConstitution.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/NonUtf8EncodedConstitution.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/ReadFileError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/ReadFileError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/ReadFileError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/ReadFileError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/StakeCredGovCmdError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/StakeCredGovCmdError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/StakeCredGovCmdError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/StakeCredGovCmdError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/VotingCredentialDecodeGovCmdEror.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/VotingCredentialDecodeGovCmdEror.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/VotingCredentialDecodeGovCmdEror.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/VotingCredentialDecodeGovCmdEror.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/WriteFileError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/WriteFileError.txt similarity index 100% rename from cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Commands.Governance.GovernanceCmdError/WriteFileError.txt rename to cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceCmdError.GovernanceCmdError/WriteFileError.txt diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceVoteCmdError.GovernanceVoteCmdError/GovernanceVoteCmeWriteError.txt b/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceVoteCmdError.GovernanceVoteCmdError/GovernanceVoteCmeWriteError.txt deleted file mode 100644 index ba12b65dde..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/errors/Cardano.CLI.Types.Errors.GovernanceVoteCmdError.GovernanceVoteCmdError/GovernanceVoteCmeWriteError.txt +++ /dev/null @@ -1 +0,0 @@ -Cannot write vote: path/file.txt: \ No newline at end of file