From 8e6f75aa7083e2e811e9f99cd1c6d93bc3d94748 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Fri, 31 May 2024 20:51:14 +0200 Subject: [PATCH 1/3] Test SPOs cannot vote PParam change proposals --- cardano-testnet/cardano-testnet.cabal | 1 + .../Cardano/Testnet/Test/Gov/DRepActivity.hs | 2 + .../Testnet/Test/Gov/PParamChangeFailsSPO.hs | 132 ++++++++++++++++++ .../cardano-testnet-test.hs | 2 + 4 files changed, 137 insertions(+) create mode 100644 cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index 61637535b0d..1dcf59dcf99 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -193,6 +193,7 @@ test-suite cardano-testnet-test Cardano.Testnet.Test.Gov.DRepRetirement Cardano.Testnet.Test.Gov.InfoAction Cardano.Testnet.Test.Gov.NoConfidence + Cardano.Testnet.Test.Gov.PParamChangeFailsSPO Cardano.Testnet.Test.Gov.ProposeNewConstitution Cardano.Testnet.Test.Gov.ProposeNewConstitutionSPO Cardano.Testnet.Test.Gov.TreasuryGrowth diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs index 178dd10c0ee..f46ec881246 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs @@ -7,6 +7,8 @@ module Cardano.Testnet.Test.Gov.DRepActivity ( hprop_check_drep_activity + , makeActivityChangeProposal + , voteChangeProposal ) where import Cardano.Api as Api diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs new file mode 100644 index 00000000000..6b69893bc5c --- /dev/null +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs @@ -0,0 +1,132 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module Cardano.Testnet.Test.Gov.PParamChangeFailsSPO + ( hprop_check_pparam_fails_spo + ) where + +import Cardano.Api as Api +import Cardano.Api.Ledger (EpochInterval (EpochInterval)) + +import Cardano.Testnet +import Cardano.Testnet.Test.Gov.DRepActivity (makeActivityChangeProposal) + +import Prelude + +import Control.Monad.Catch (MonadCatch) +import Data.Typeable (Typeable) +import Data.Word (Word32) +import System.FilePath (()) + +import Testnet.Components.Query +import Testnet.Defaults (defaultSpoColdKeyPair, defaultSpoKeys) +import Testnet.Process.Cli.DRep +import qualified Testnet.Process.Cli.SPO as SPO +import Testnet.Process.Cli.Transaction (failToSubmitTx, signTx) +import Testnet.Process.Run (mkExecConfig) +import Testnet.Property.Util (integrationWorkspace) +import Testnet.Types + +import Hedgehog (Property, annotateShow) +import qualified Hedgehog.Extras as H +import Hedgehog.Internal.Property (MonadTest) +import Hedgehog.Internal.Source (HasCallStack, withFrozenCallStack) + +-- | Test that SPOs cannot vote on a Protocol Parameter change +-- | Execute me with: +-- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/PParam change fails for SPO/"'@ +hprop_check_pparam_fails_spo :: Property +hprop_check_pparam_fails_spo = integrationWorkspace "test-pparam-spo" $ \tempAbsBasePath' -> + H.runWithDefaultWatchdog_ $ do + -- Start a local test net + conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let tempAbsPath' = unTmpAbsPath tempAbsPath + tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath + + work <- H.createDirectoryIfMissing $ tempAbsPath' "work" + + -- Create default testnet + let ceo = ConwayEraOnwardsConway + sbe = conwayEraOnwardsToShelleyBasedEra ceo + era = toCardanoEra sbe + cEra = AnyCardanoEra era + fastTestnetOptions = cardanoDefaultTestnetOptions + { cardanoEpochLength = 200 + , cardanoNodeEra = cEra + } + + TestnetRuntime + { testnetMagic + , poolNodes + , wallets=wallet0:wallet1:_wallet2:_ + , configurationFile + } + <- cardanoTestnetDefault fastTestnetOptions conf + + PoolNode{poolRuntime} <- H.headM poolNodes + poolSprocket1 <- H.noteShow $ nodeSprocket poolRuntime + execConfig <- mkExecConfig tempBaseAbsPath poolSprocket1 testnetMagic + let socketPath = nodeSocketPath poolRuntime + + epochStateView <- getEpochStateView configurationFile socketPath + + H.note_ $ "Sprocket: " <> show poolSprocket1 + H.note_ $ "Abs path: " <> tempAbsBasePath' + H.note_ $ "Socketpath: " <> unFile socketPath + H.note_ $ "Foldblocks config file: " <> unFile configurationFile + + gov <- H.createDirectoryIfMissing $ work "governance" + + baseDir <- H.createDirectoryIfMissing $ gov "output" + + + let propVotes :: [(String, Int)] + propVotes = zip (concatMap (uncurry replicate) [(1, "yes")]) [1..] + annotateShow propVotes + + (governanceActionTxId, governanceActionIndex) <- + makeActivityChangeProposal execConfig epochStateView ceo baseDir "proposal" + Nothing (EpochInterval 3) wallet0 (EpochInterval 2) + + failToVoteChangeProposalWithSPOs ceo execConfig epochStateView sbe baseDir "vote" + governanceActionTxId governanceActionIndex propVotes wallet1 + +-- | Cast votes for a governance action with SPO keys. +failToVoteChangeProposalWithSPOs + :: (HasCallStack, MonadTest m, MonadIO m, MonadCatch m, H.MonadAssertion m, Typeable era) + => ConwayEraOnwards era -- ^ The conway era onwards witness for the era in which the + -- transaction will be constructed. + -> H.ExecConfig -- ^ Specifies the CLI execution configuration.v + -> EpochStateView -- ^ Current epoch state view for transaction building. It can be obtained + -- using the 'getEpochStateView' function. + -> ShelleyBasedEra era -- ^ The 'ShelleyBasedEra' witness for current era. + -> FilePath -- ^ Base directory path where generated files will be stored. + -> String -- ^ Name for the subfolder that will be created under 'work' folder. + -> String -- ^ The transaction id of the governance action to vote. + -> Word32 -- ^ The index of the governance action to vote. + -> [([Char], Int)] -- ^ Votes to be casted for the proposal. Each tuple contains the index + -- of the default SPO that will make the vote and the type of the vote + -- (i.e: "yes", "no", "abstain"). + -> PaymentKeyInfo -- ^ Wallet that will pay for the transaction. + -> m () +failToVoteChangeProposalWithSPOs ceo execConfig epochStateView sbe work prefix + governanceActionTxId governanceActionIndex votes wallet = withFrozenCallStack $ do + baseDir <- H.createDirectoryIfMissing $ work prefix + + let era = toCardanoEra sbe + cEra = AnyCardanoEra era + + voteFiles <- SPO.generateVoteFiles ceo execConfig baseDir "vote-files" + governanceActionTxId governanceActionIndex + [(defaultSpoKeys idx, vote) | (vote, idx) <- votes] + + voteTxBodyFp <- createVotingTxBody execConfig epochStateView sbe baseDir "vote-tx-body" + voteFiles wallet + + let signingKeys = SomeKeyPair (paymentKeyInfoPair wallet):(SomeKeyPair . defaultSpoColdKeyPair . snd <$> votes) + voteTxFp <- signTx execConfig cEra baseDir "signed-vote-tx" voteTxBodyFp signingKeys + + failToSubmitTx execConfig cEra voteTxFp "DisallowedVoters" diff --git a/cardano-testnet/test/cardano-testnet-test/cardano-testnet-test.hs b/cardano-testnet/test/cardano-testnet-test/cardano-testnet-test.hs index 693502e446c..5c4e1cafe44 100644 --- a/cardano-testnet/test/cardano-testnet-test/cardano-testnet-test.hs +++ b/cardano-testnet/test/cardano-testnet-test/cardano-testnet-test.hs @@ -17,6 +17,7 @@ import qualified Cardano.Testnet.Test.Gov.CommitteeAddNew as Gov import qualified Cardano.Testnet.Test.Gov.DRepDeposit as Gov import qualified Cardano.Testnet.Test.Gov.DRepRetirement as Gov import qualified Cardano.Testnet.Test.Gov.NoConfidence as Gov +import qualified Cardano.Testnet.Test.Gov.PParamChangeFailsSPO as Gov import qualified Cardano.Testnet.Test.Gov.ProposeNewConstitution as Gov import qualified Cardano.Testnet.Test.Gov.ProposeNewConstitutionSPO as Gov import qualified Cardano.Testnet.Test.Gov.TreasuryGrowth as Gov @@ -59,6 +60,7 @@ tests = do , ignoreOnMacAndWindows "Propose And Ratify New Constitution" Gov.hprop_ledger_events_propose_new_constitution , ignoreOnWindows "Propose New Constitution SPO" Gov.hprop_ledger_events_propose_new_constitution_spo , ignoreOnWindows "Treasury Withdrawal" Gov.hprop_ledger_events_treasury_withdrawal + , ignoreOnWindows "PParam change fails for SPO" Gov.hprop_check_pparam_fails_spo -- FIXME Those tests are flaky -- , ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action ] From f1bf8b12e966ee93080f7ab2038b1c8a8e4eb191 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 6 Jun 2024 21:16:27 +0200 Subject: [PATCH 2/3] Move `makeActivityChangeProposal` to `DRep.hs` --- .../src/Testnet/Process/Cli/DRep.hs | 91 ++++++++++++++++++- .../Cardano/Testnet/Test/Gov/DRepActivity.hs | 91 +------------------ .../Testnet/Test/Gov/PParamChangeFailsSPO.hs | 1 - 3 files changed, 91 insertions(+), 92 deletions(-) diff --git a/cardano-testnet/src/Testnet/Process/Cli/DRep.hs b/cardano-testnet/src/Testnet/Process/Cli/DRep.hs index 4406b8408cb..ad6eff60d8c 100644 --- a/cardano-testnet/src/Testnet/Process/Cli/DRep.hs +++ b/cardano-testnet/src/Testnet/Process/Cli/DRep.hs @@ -13,10 +13,13 @@ module Testnet.Process.Cli.DRep , registerDRep , delegateToDRep , getLastPParamUpdateActionId + , makeActivityChangeProposal ) where import Cardano.Api hiding (Certificate, TxBody) -import Cardano.Api.Ledger (EpochInterval (EpochInterval)) +import Cardano.Api.Ledger (EpochInterval (EpochInterval, unEpochInterval)) + +import Cardano.Testnet (maybeExtractGovernanceActionIndex) import Prelude @@ -26,12 +29,15 @@ import qualified Data.Aeson as Aeson import qualified Data.Aeson.Lens as AL import Data.Text (Text) import qualified Data.Text as Text +import Data.Typeable (Typeable) import Data.Word (Word32) +import GHC.Exts (fromString) import GHC.Stack import Lens.Micro ((^?)) import System.FilePath (()) import Testnet.Components.Query +import Testnet.Process.Cli.Keys (cliStakeAddressKeyGen) import Testnet.Process.Cli.Transaction import Testnet.Process.Run (execCli', execCliStdoutToJson) import Testnet.Types @@ -329,3 +335,86 @@ getLastPParamUpdateActionId execConfig = do actionIx <- evalMaybe mActionIx txId <- evalMaybe mTxId return (Just (Text.unpack txId, fromIntegral actionIx)) + +-- | Create a proposal to change the DRep activity interval. +-- Return the transaction id and the index of the governance action. +makeActivityChangeProposal + :: (HasCallStack, H.MonadAssertion m, MonadTest m, MonadCatch m, MonadIO m, Typeable era) + => H.ExecConfig -- ^ Specifies the CLI execution configuration. + -> EpochStateView -- ^ Current epoch state view for transaction building. It can be obtained + -- using the 'getEpochStateView' function. + -> ConwayEraOnwards era -- ^ The 'ConwayEraOnwards' witness for current era. + -> FilePath -- ^ Base directory path where generated files will be stored. + -> String -- ^ Name for the subfolder that will be created under 'work' folder. + -> Maybe (String, Word32) -- ^ The transaction id and the index of the previosu governance action if any. + -> EpochInterval -- ^ The target DRep activity interval to be set by the proposal. + -> PaymentKeyInfo -- ^ Wallet that will pay for the transaction. + -> EpochInterval -- ^ Number of epochs to wait for the proposal to be registered by the chain. + -> m (String, Word32) -- ^ The transaction id and the index of the governance action. +makeActivityChangeProposal execConfig epochStateView ceo work prefix + prevGovActionInfo drepActivity wallet timeout = do + + let sbe = conwayEraOnwardsToShelleyBasedEra ceo + era = toCardanoEra sbe + cEra = AnyCardanoEra era + + baseDir <- H.createDirectoryIfMissing $ work prefix + + let stakeVkeyFp = baseDir "stake.vkey" + stakeSKeyFp = baseDir "stake.skey" + + cliStakeAddressKeyGen + $ KeyPair { verificationKey = File stakeVkeyFp + , signingKey = File stakeSKeyFp + } + + proposalAnchorFile <- H.note $ baseDir "sample-proposal-anchor" + H.writeFile proposalAnchorFile "dummy anchor data" + + proposalAnchorDataHash <- execCli' execConfig + [ "conway", "governance" + , "hash", "anchor-data", "--file-text", proposalAnchorFile + ] + + minDRepDeposit <- getMinDRepDeposit epochStateView ceo + + proposalFile <- H.note $ baseDir "sample-proposal-anchor" + + void $ execCli' execConfig $ + [ "conway", "governance", "action", "create-protocol-parameters-update" + , "--testnet" + , "--governance-action-deposit", show @Integer minDRepDeposit + , "--deposit-return-stake-verification-key-file", stakeVkeyFp + ] ++ concatMap (\(prevGovernanceActionTxId, prevGovernanceActionIndex) -> + [ "--prev-governance-action-tx-id", prevGovernanceActionTxId + , "--prev-governance-action-index", show prevGovernanceActionIndex + ]) prevGovActionInfo ++ + [ "--drep-activity", show (unEpochInterval drepActivity) + , "--anchor-url", "https://tinyurl.com/3wrwb2as" + , "--anchor-data-hash", proposalAnchorDataHash + , "--out-file", proposalFile + ] + + proposalBody <- H.note $ baseDir "tx.body" + txIn <- findLargestUtxoForPaymentKey epochStateView sbe wallet + + void $ execCli' execConfig + [ "conway", "transaction", "build" + , "--change-address", Text.unpack $ paymentKeyInfoAddr wallet + , "--tx-in", Text.unpack $ renderTxIn txIn + , "--proposal-file", proposalFile + , "--out-file", proposalBody + ] + + signedProposalTx <- signTx execConfig cEra baseDir "signed-proposal" + (File proposalBody) [SomeKeyPair $ paymentKeyInfoPair wallet] + + submitTx execConfig cEra signedProposalTx + + governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx + + governanceActionIndex <- + H.nothingFailM $ watchEpochStateUpdate epochStateView timeout $ \(anyNewEpochState, _, _) -> + return $ maybeExtractGovernanceActionIndex (fromString governanceActionTxId) anyNewEpochState + + return (governanceActionTxId, governanceActionIndex) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs index f46ec881246..c3bec1a1bd3 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs @@ -3,12 +3,9 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} module Cardano.Testnet.Test.Gov.DRepActivity ( hprop_check_drep_activity - , makeActivityChangeProposal - , voteChangeProposal ) where import Cardano.Api as Api @@ -26,8 +23,6 @@ import Control.Monad import Control.Monad.Catch (MonadCatch) import Data.Data (Typeable) import qualified Data.Map as Map -import Data.String -import qualified Data.Text as Text import Data.Word (Word32) import GHC.Stack (HasCallStack, withFrozenCallStack) import System.FilePath (()) @@ -35,9 +30,8 @@ import System.FilePath (()) import Testnet.Components.Query import Testnet.Defaults (defaultDRepKeyPair, defaultDelegatorStakeKeyPair) import Testnet.Process.Cli.DRep -import Testnet.Process.Cli.Keys import Testnet.Process.Cli.Transaction -import Testnet.Process.Run (execCli', mkExecConfig) +import Testnet.Process.Run (mkExecConfig) import Testnet.Property.Util (integrationWorkspace) import Testnet.Types @@ -210,89 +204,6 @@ activityChangeProposalTest execConfig epochStateView ceo work prefix pure thisProposal --- | Create a proposal to change the DRep activity interval. --- Return the transaction id and the index of the governance action. -makeActivityChangeProposal - :: (HasCallStack, H.MonadAssertion m, MonadTest m, MonadCatch m, MonadIO m, Typeable era) - => H.ExecConfig -- ^ Specifies the CLI execution configuration. - -> EpochStateView -- ^ Current epoch state view for transaction building. It can be obtained - -- using the 'getEpochStateView' function. - -> ConwayEraOnwards era -- ^ The 'ConwayEraOnwards' witness for current era. - -> FilePath -- ^ Base directory path where generated files will be stored. - -> String -- ^ Name for the subfolder that will be created under 'work' folder. - -> Maybe (String, Word32) -- ^ The transaction id and the index of the previosu governance action if any. - -> EpochInterval -- ^ The target DRep activity interval to be set by the proposal. - -> PaymentKeyInfo -- ^ Wallet that will pay for the transaction. - -> EpochInterval -- ^ Number of epochs to wait for the proposal to be registered by the chain. - -> m (String, Word32) -- ^ The transaction id and the index of the governance action. -makeActivityChangeProposal execConfig epochStateView ceo work prefix - prevGovActionInfo drepActivity wallet timeout = do - - let sbe = conwayEraOnwardsToShelleyBasedEra ceo - era = toCardanoEra sbe - cEra = AnyCardanoEra era - - baseDir <- H.createDirectoryIfMissing $ work prefix - - let stakeVkeyFp = baseDir "stake.vkey" - stakeSKeyFp = baseDir "stake.skey" - - cliStakeAddressKeyGen - $ KeyPair { verificationKey = File stakeVkeyFp - , signingKey = File stakeSKeyFp - } - - proposalAnchorFile <- H.note $ baseDir "sample-proposal-anchor" - H.writeFile proposalAnchorFile "dummy anchor data" - - proposalAnchorDataHash <- execCli' execConfig - [ "conway", "governance" - , "hash", "anchor-data", "--file-text", proposalAnchorFile - ] - - minDRepDeposit <- getMinDRepDeposit epochStateView ceo - - proposalFile <- H.note $ baseDir "sample-proposal-anchor" - - void $ execCli' execConfig $ - [ "conway", "governance", "action", "create-protocol-parameters-update" - , "--testnet" - , "--governance-action-deposit", show @Integer minDRepDeposit - , "--deposit-return-stake-verification-key-file", stakeVkeyFp - ] ++ concatMap (\(prevGovernanceActionTxId, prevGovernanceActionIndex) -> - [ "--prev-governance-action-tx-id", prevGovernanceActionTxId - , "--prev-governance-action-index", show prevGovernanceActionIndex - ]) prevGovActionInfo ++ - [ "--drep-activity", show (unEpochInterval drepActivity) - , "--anchor-url", "https://tinyurl.com/3wrwb2as" - , "--anchor-data-hash", proposalAnchorDataHash - , "--out-file", proposalFile - ] - - proposalBody <- H.note $ baseDir "tx.body" - txIn <- findLargestUtxoForPaymentKey epochStateView sbe wallet - - void $ execCli' execConfig - [ "conway", "transaction", "build" - , "--change-address", Text.unpack $ paymentKeyInfoAddr wallet - , "--tx-in", Text.unpack $ renderTxIn txIn - , "--proposal-file", proposalFile - , "--out-file", proposalBody - ] - - signedProposalTx <- signTx execConfig cEra baseDir "signed-proposal" - (File proposalBody) [SomeKeyPair $ paymentKeyInfoPair wallet] - - submitTx execConfig cEra signedProposalTx - - governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx - - governanceActionIndex <- - H.nothingFailM $ watchEpochStateUpdate epochStateView timeout $ \(anyNewEpochState, _, _) -> - return $ maybeExtractGovernanceActionIndex (fromString governanceActionTxId) anyNewEpochState - - return (governanceActionTxId, governanceActionIndex) - -- | Cast votes for a governance action. voteChangeProposal :: (HasCallStack, MonadTest m, MonadIO m, MonadCatch m, H.MonadAssertion m, Typeable era) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs index 6b69893bc5c..40606b78660 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs @@ -12,7 +12,6 @@ import Cardano.Api as Api import Cardano.Api.Ledger (EpochInterval (EpochInterval)) import Cardano.Testnet -import Cardano.Testnet.Test.Gov.DRepActivity (makeActivityChangeProposal) import Prelude From 81b4fe81de3c08e41d8d839d4dd78eadcb9814d2 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 6 Jun 2024 21:25:33 +0200 Subject: [PATCH 3/3] Remove unnecessary parameter from `failToVoteChangeProposalWithSPOs` function --- .../Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs index 40606b78660..dd58bb6d683 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs @@ -90,7 +90,7 @@ hprop_check_pparam_fails_spo = integrationWorkspace "test-pparam-spo" $ \tempAbs makeActivityChangeProposal execConfig epochStateView ceo baseDir "proposal" Nothing (EpochInterval 3) wallet0 (EpochInterval 2) - failToVoteChangeProposalWithSPOs ceo execConfig epochStateView sbe baseDir "vote" + failToVoteChangeProposalWithSPOs ceo execConfig epochStateView baseDir "vote" governanceActionTxId governanceActionIndex propVotes wallet1 -- | Cast votes for a governance action with SPO keys. @@ -101,7 +101,6 @@ failToVoteChangeProposalWithSPOs -> H.ExecConfig -- ^ Specifies the CLI execution configuration.v -> EpochStateView -- ^ Current epoch state view for transaction building. It can be obtained -- using the 'getEpochStateView' function. - -> ShelleyBasedEra era -- ^ The 'ShelleyBasedEra' witness for current era. -> FilePath -- ^ Base directory path where generated files will be stored. -> String -- ^ Name for the subfolder that will be created under 'work' folder. -> String -- ^ The transaction id of the governance action to vote. @@ -111,11 +110,12 @@ failToVoteChangeProposalWithSPOs -- (i.e: "yes", "no", "abstain"). -> PaymentKeyInfo -- ^ Wallet that will pay for the transaction. -> m () -failToVoteChangeProposalWithSPOs ceo execConfig epochStateView sbe work prefix +failToVoteChangeProposalWithSPOs ceo execConfig epochStateView work prefix governanceActionTxId governanceActionIndex votes wallet = withFrozenCallStack $ do baseDir <- H.createDirectoryIfMissing $ work prefix - let era = toCardanoEra sbe + let sbe = conwayEraOnwardsToShelleyBasedEra ceo + era = toCardanoEra sbe cEra = AnyCardanoEra era voteFiles <- SPO.generateVoteFiles ceo execConfig baseDir "vote-files"