Skip to content

Commit

Permalink
Disable DRep Activity
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer authored and Lucsanszky committed May 15, 2024
1 parent 902cac4 commit b1d33e8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ library
, aeson-pretty
, ansi-terminal
, bytestring
, cardano-api:{cardano-api, internal} ^>= 8.46
, cardano-api ^>= 8.46
, cardano-cli ^>= 8.23
, cardano-crypto-class
, cardano-crypto-wrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import qualified Testnet.Process.Cli.DRep as DRep
import Testnet.Process.Cli.Keys
import qualified Testnet.Process.Cli.SPO as SPO
import Testnet.Process.Cli.Transaction
import Testnet.Process.Run (execCli', execCliAny, mkExecConfig)
import Testnet.Process.Run (execCli', mkExecConfig)
import Testnet.Property.Util (integrationWorkspace)
import Testnet.Types

Expand Down Expand Up @@ -172,7 +172,6 @@ hprop_constitutional_committee_add_new = integrationWorkspace "constitutional-co

signedProposalTx <-
signTx execConfig cEra work "signed-proposal" (File txbodyFp) [SomeKeyPair $ paymentKeyInfoPair wallet0]

submitTx execConfig cEra signedProposalTx

governanceActionTxId <- H.noteM $ retrieveTransactionId execConfig signedProposalTx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ import qualified Data.Map as Map
import Data.String
import qualified Data.Text as Text
import Data.Word (Word32, Word64)
import GHC.Stack (HasCallStack, callStack)
import GHC.Stack
import Lens.Micro ((^.))
import System.FilePath ((</>))

import Testnet.Components.Configuration
import Testnet.Components.Query
import Testnet.Components.TestWatchdog (runWithDefaultWatchdog_)
import Testnet.Defaults (defaultDRepKeyPair, defaultDelegatorStakeKeyPair)
Expand Down Expand Up @@ -100,7 +99,6 @@ hprop_check_drep_activity = integrationWorkspace "test-activity" $ \tempAbsBaseP
-- make sure it doesn't change.
maxEpochsToWaitAfterProposal = EpochInterval 2 -- If it takes more than 2 epochs we give up in any case.
firstTargetDRepActivity = EpochInterval 3

void $ activityChangeProposalTest execConfig epochStateView configurationFile socketPath ceo gov
"firstProposal" wallet0 [(1, "yes")] firstTargetDRepActivity
minEpochsToWaitIfChanging (Just firstTargetDRepActivity)
Expand Down Expand Up @@ -328,7 +326,7 @@ voteChangeProposal
-- (i.e: "yes", "no", "abstain").
-> PaymentKeyInfo -- ^ Wallet that will pay for the transaction.
-> m ()
voteChangeProposal execConfig epochStateView sbe work prefix governanceActionTxId governanceActionIndex votes wallet = do
voteChangeProposal execConfig epochStateView sbe work prefix governanceActionTxId governanceActionIndex votes wallet = withFrozenCallStack $ do
baseDir <- H.createDirectoryIfMissing $ work </> prefix

let era = toCardanoEra sbe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ hprop_ledger_events_propose_new_constitution = integrationWorkspace "propose-new
(EpochNo 10)

governanceActionIndex <- case propSubmittedResult of
Left e ->
H.failMessage callStack
Left e ->
H.failMessage callStack
$ "findCondition failed with: " <> displayError e
Right Nothing ->
H.failMessage callStack "Couldn't find proposal."
Right (Just a) -> return a
Right Nothing ->
H.failMessage callStack "Couldn't find proposal."
Right (Just a) -> return a

-- Proposal was successfully submitted, now we vote on the proposal and confirm it was ratified
voteFiles <- generateVoteFiles execConfig work "vote-files"
governanceActionTxId governanceActionIndex
[(defaultDRepKeyPair idx, vote) | (vote, idx) <- allVotes]
governanceActionTxId governanceActionIndex
[(defaultDRepKeyPair idx, vote) | (vote, idx) <- allVotes]

-- Submit votes
voteTxBodyFp <- createVotingTxBody execConfig epochStateView sbe work "vote-tx-body"
voteFiles wallet0
voteFiles wallet0

let signingKeys = SomeKeyPair <$> (paymentKeyInfoPair wallet0:(defaultDRepKeyPair . snd <$> allVotes))
voteTxFp <- signTx execConfig cEra gov "signed-vote-tx" voteTxBodyFp signingKeys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ hprop_ledger_events_propose_new_constitution_spo = integrationWorkspace "propose
let L.GovActionIx governanceActionIndex = L.gaidGovActionIx govActionId

votes <- SPO.generateVoteFiles ceo execConfig work "vote-files" txIdString governanceActionIndex
[(defaultSpoKeys n, "yes") | n <- [1..3]]
[(defaultSpoKeys n, "yes") | n <- [1..3]]

-- Submit votes
votesTxBody <- createVotingTxBody execConfig epochStateView sbe work "vote-tx-body" votes wallet0

votesSignedTx <- signTx execConfig cEra work "vote-signed-tx"
votesTxBody (SomeKeyPair (paymentKeyInfoPair wallet0)
votesTxBody (SomeKeyPair (paymentKeyInfoPair wallet0)
:[SomeKeyPair $ defaultSpoColdKeyPair n | n <- [1..3]])

-- Call should fail, because SPOs are unallowed to vote on the constitution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import qualified Cardano.Testnet.Test.Cli.Query
import qualified Cardano.Testnet.Test.Cli.QuerySlotNumber
import qualified Cardano.Testnet.Test.FoldEpochState
import qualified Cardano.Testnet.Test.Gov.CommitteeAddNew as Gov
import qualified Cardano.Testnet.Test.Gov.DRepActivity 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.ProposeNewConstitution as Gov
Expand Down Expand Up @@ -50,7 +49,8 @@ tests = do
-- TODO: Replace foldBlocks with checkLedgerStateCondition
, T.testGroup "Governance"
[ ignoreOnMacAndWindows "Committee Add New" Gov.hprop_constitutional_committee_add_new
, ignoreOnWindows "DRep Activity" Gov.hprop_check_drep_activity
-- FIXME: This test is broken - drepActivity is not updated within the expeted period
-- , ignoreOnWindows "DRep Activity" Gov.hprop_check_drep_activity
, ignoreOnWindows "DRep Deposits" Gov.hprop_ledger_events_drep_deposits
-- FIXME Those tests are flaky
-- , ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action
Expand Down

0 comments on commit b1d33e8

Please sign in to comment.