Skip to content

Commit 06ef149

Browse files
committed
Fixes required by rebasing
1 parent 5e484d7 commit 06ef149

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

cardano-testnet/src/Testnet/EpochStateProcessing.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ module Testnet.EpochStateProcessing
55
, findCondition
66
) where
77

8-
import Cardano.Api (AnyNewEpochState (..), ConwayEra, EpochNo, File (File),
9-
FoldBlocksError, LedgerStateCondition (..), MonadIO, ShelleyBasedEra,
10-
ValidationMode (FullValidation), foldEpochState, runExceptT,
11-
shelleyBasedEraConstraints)
8+
import Cardano.Api (AnyNewEpochState (..), ConwayEra, ConwayEraOnwards, EpochNo,
9+
File (File), FoldBlocksError, LedgerStateCondition (..), MonadIO,
10+
ValidationMode (FullValidation), conwayEraOnwardsToShelleyBasedEra,
11+
foldEpochState, runExceptT, shelleyBasedEraConstraints)
1212
import qualified Cardano.Api as Api
1313
import Cardano.Api.Ledger (GovActionId (..))
1414
import qualified Cardano.Api.Ledger as L
@@ -58,11 +58,13 @@ findCondition epochStateFoldFunc configurationFile socketPath maxEpochNo = withF
5858
Just x -> put (Just x) >> pure ConditionMet
5959
Nothing -> pure ConditionNotMet
6060

61-
maybeExtractGovernanceActionIndex :: ShelleyBasedEra ConwayEra -- ^ The era in which the test runs
61+
maybeExtractGovernanceActionIndex :: ()
62+
=> ConwayEraOnwards ConwayEra -- ^ The era in which the test runs
6263
-> Api.TxId
6364
-> AnyNewEpochState
6465
-> Maybe Word32
65-
maybeExtractGovernanceActionIndex sbe txid (AnyNewEpochState actualEra newEpochState) =
66+
maybeExtractGovernanceActionIndex ceo txid (AnyNewEpochState actualEra newEpochState) =
67+
let sbe = conwayEraOnwardsToShelleyBasedEra ceo in
6668
case testEquality sbe actualEra of
6769
Just Refl -> do
6870
let proposals = shelleyBasedEraConstraints sbe newEpochState

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/DRepActivity.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ makeActivityChangeProposal execConfig epochStateView configurationFile socketPat
307307

308308
governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx
309309

310-
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex sbe (fromString governanceActionTxId))
310+
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex ceo (fromString governanceActionTxId))
311311
(unFile configurationFile)
312312
(unFile socketPath)
313313
(EpochNo timeout)

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \t
5555

5656
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"
5757

58-
let sbe = ShelleyBasedEraConway
58+
let ceo = ConwayEraOnwardsConway
59+
sbe = conwayEraOnwardsToShelleyBasedEra ceo
5960
era = toCardanoEra sbe
6061
fastTestnetOptions = cardanoDefaultTestnetOptions
6162
{ cardanoEpochLength = 100
@@ -149,7 +150,7 @@ hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \t
149150
, "--tx-file", txbodySignedFp
150151
]
151152

152-
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex sbe (fromString txidString))
153+
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex ceo (fromString txidString))
153154
configurationFile
154155
socketPath
155156
(EpochNo 10)

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/PredefinedAbstainDRep.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Control.Monad.Catch (MonadCatch)
2525
import qualified Data.Aeson as Aeson
2626
import qualified Data.Aeson.Lens as AL
2727
import Data.ByteString.Lazy.Char8 (pack)
28+
import Data.Data (Typeable)
2829
import Data.String (fromString)
2930
import qualified Data.Text as Text
3031
import Data.Word (Word32)
@@ -198,7 +199,6 @@ desiredPoolNumberProposalTest
198199
-> m (String, Word32)
199200
desiredPoolNumberProposalTest execConfig epochStateView configurationFile socketPath ceo work prefix
200201
wallet previousProposalInfo votes change expected epochsToWait = do
201-
let sbe = conwayEraOnwardsToShelleyBasedEra ceo
202202

203203
baseDir <- H.createDirectoryIfMissing $ work </> prefix
204204

@@ -210,7 +210,7 @@ desiredPoolNumberProposalTest execConfig epochStateView configurationFile socket
210210
makeDesiredPoolNumberChangeProposal execConfig epochStateView (File configurationFile) (File socketPath)
211211
ceo baseDir "proposal" previousProposalInfo (fromIntegral change) wallet
212212

213-
voteChangeProposal execConfig epochStateView sbe baseDir "vote"
213+
voteChangeProposal execConfig epochStateView ceo baseDir "vote"
214214
governanceActionTxId governanceActionIndex propVotes [] wallet
215215

216216
(EpochNo epochAfterProp) <- getCurrentEpochNo epochStateView
@@ -298,7 +298,7 @@ makeDesiredPoolNumberChangeProposal execConfig epochStateView configurationFile
298298

299299
governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx
300300

301-
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex sbe (fromString governanceActionTxId))
301+
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex ceo (fromString governanceActionTxId))
302302
(unFile configurationFile)
303303
(unFile socketPath)
304304
(EpochNo 30)
@@ -313,10 +313,10 @@ makeDesiredPoolNumberChangeProposal execConfig epochStateView configurationFile
313313

314314
return (governanceActionTxId, governanceActionIndex)
315315

316-
voteChangeProposal :: (MonadTest m, MonadIO m, MonadCatch m, H.MonadAssertion m)
316+
voteChangeProposal :: (Typeable era, MonadTest m, MonadIO m, MonadCatch m, H.MonadAssertion m)
317317
=> H.ExecConfig
318318
-> EpochStateView
319-
-> ShelleyBasedEra ConwayEra
319+
-> ConwayEraOnwards era
320320
-> FilePath
321321
-> FilePath
322322
-> String
@@ -325,10 +325,11 @@ voteChangeProposal :: (MonadTest m, MonadIO m, MonadCatch m, H.MonadAssertion m)
325325
-> [(String, Int)]
326326
-> PaymentKeyInfo
327327
-> m ()
328-
voteChangeProposal execConfig epochStateView sbe work prefix governanceActionTxId governanceActionIndex drepVotes spoVotes wallet = do
328+
voteChangeProposal execConfig epochStateView ceo work prefix governanceActionTxId governanceActionIndex drepVotes spoVotes wallet = do
329329
baseDir <- H.createDirectoryIfMissing $ work </> prefix
330330

331-
let era = toCardanoEra sbe
331+
let sbe = conwayEraOnwardsToShelleyBasedEra ceo
332+
era = toCardanoEra sbe
332333
cEra = AnyCardanoEra era
333334

334335
drepVoteFiles <- DRep.generateVoteFiles execConfig baseDir "drep-vote-files"

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/PredefinedNoConfidenceDRep.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ updateConstitutionalCommittee
188188
-> m (String, Word32)
189189
updateConstitutionalCommittee execConfig epochStateView configurationFile socketPath ceo work prefix
190190
wallet previousProposalInfo votes waitTillEpoch = do
191-
let sbe = conwayEraOnwardsToShelleyBasedEra ceo
192191

193192
baseDir <- H.createDirectoryIfMissing $ work </> prefix
194193

@@ -214,7 +213,7 @@ updateConstitutionalCommittee execConfig epochStateView configurationFile socket
214213
makeUpdateConstitutionalCommitteeProposal execConfig epochStateView (File configurationFile) (File socketPath)
215214
ceo baseDir "proposal" previousProposalInfo [coldKeyHash] wallet
216215

217-
voteChangeProposal execConfig epochStateView sbe baseDir "vote"
216+
voteChangeProposal execConfig epochStateView ceo baseDir "vote"
218217
governanceActionTxId governanceActionIndex propVotes (zip (repeat "yes") [1..3]) wallet
219218

220219
(EpochNo epochAfterProp) <- getCurrentEpochNo epochStateView
@@ -304,7 +303,7 @@ makeUpdateConstitutionalCommitteeProposal execConfig epochStateView configuratio
304303

305304
governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx
306305

307-
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex sbe (fromString governanceActionTxId))
306+
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex ceo (fromString governanceActionTxId))
308307
(unFile configurationFile)
309308
(unFile socketPath)
310309
(EpochNo 10)
@@ -351,7 +350,7 @@ testNoConfidenceProposal
351350
-> m (String, Word32)
352351
testNoConfidenceProposal execConfig epochStateView configurationFile socketPath ceo work prefix
353352
wallet previousProposalInfo votes waitTillEpoch = do
354-
let sbe = conwayEraOnwardsToShelleyBasedEra ceo
353+
355354
baseDir <- H.createDirectoryIfMissing $ work </> prefix
356355

357356
let propVotes :: [(String, Int)]
@@ -362,7 +361,7 @@ testNoConfidenceProposal execConfig epochStateView configurationFile socketPath
362361
makeNoConfidenceProposal execConfig epochStateView (File configurationFile) (File socketPath)
363362
ceo baseDir "proposal" previousProposalInfo wallet
364363

365-
voteChangeProposal execConfig epochStateView sbe baseDir "vote"
364+
voteChangeProposal execConfig epochStateView ceo baseDir "vote"
366365
governanceActionTxId governanceActionIndex propVotes (zip (repeat "yes") [1..3]) wallet
367366

368367
(EpochNo epochAfterProp) <- getCurrentEpochNo epochStateView
@@ -444,7 +443,7 @@ makeNoConfidenceProposal execConfig epochStateView configurationFile socketPath
444443

445444
governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx
446445

447-
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex sbe (fromString governanceActionTxId))
446+
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex ceo (fromString governanceActionTxId))
448447
(unFile configurationFile)
449448
(unFile socketPath)
450449
(EpochNo 30)

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n
172172

173173
governanceActionTxId <- retrieveTransactionId execConfig signedProposalTx
174174

175-
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex sbe (fromString governanceActionTxId))
175+
!propSubmittedResult <- findCondition (maybeExtractGovernanceActionIndex ceo (fromString governanceActionTxId))
176176
configurationFile
177177
socketPath
178178
(EpochNo 10)
@@ -205,7 +205,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n
205205
(File configurationFile)
206206
(File socketPath)
207207
FullValidation
208-
(EpochNo 10)
208+
(EpochNo 30)
209209
()
210210
(\epochState _ _ -> foldBlocksCheckConstitutionWasRatified constitutionHash constitutionScriptHash epochState)
211211

0 commit comments

Comments
 (0)