Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Lamela authored and palas committed Mar 14, 2024
1 parent cab035c commit de0fd2c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cardano-testnet/src/Testnet/Components/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ waitUntilEpoch
waitUntilEpoch nodeConfigFile socketPath desiredEpoch = withFrozenCallStack $ do
result <- runExceptT $
foldEpochState
nodeConfigFile socketPath QuickValidation desiredEpoch () (const $ pure ConditionNotMet)
nodeConfigFile socketPath QuickValidation desiredEpoch () (\_ _ _ -> pure ConditionNotMet)
case result of
Left (FoldBlocksApplyBlockError (TerminationEpochReached epochNo)) ->
pure epochNo
Expand Down Expand Up @@ -133,7 +133,7 @@ getEpochStateView
getEpochStateView nodeConfigFile socketPath = withFrozenCallStack $ do
epochStateView <- liftIO $ newIORef Nothing
runInBackground . runExceptT . foldEpochState nodeConfigFile socketPath QuickValidation (EpochNo maxBound) Nothing
$ \epochState -> do
$ \epochState _ _ -> do
liftIO $ writeIORef epochStateView (Just epochState)
pure ConditionNotMet
pure . EpochStateView $ epochStateView
Expand Down Expand Up @@ -257,7 +257,7 @@ checkDRepsNumber' ::
-> m (Maybe [L.DRepState StandardCrypto]) -- ^ The DReps when the expected number of DReps was attained.
checkDRepsNumber' sbe nodeConfigFile socketPath maxEpoch expectedDRepsNb = do
result <- runExceptT $ foldEpochState nodeConfigFile socketPath QuickValidation maxEpoch Nothing
$ \(AnyNewEpochState actualEra newEpochState) -> do
$ \(AnyNewEpochState actualEra newEpochState) _ _ -> do
case testEquality sbe actualEra of
Just Refl -> do
let dreps = Map.elems $ shelleyBasedEraConstraints sbe newEpochState
Expand Down
5 changes: 3 additions & 2 deletions cardano-testnet/src/Testnet/Runtime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ startLedgerNewEpochStateLogging testnetRuntime tmpWorkspace = withFrozenCallStac
(handler logFile)
H.note_ $ "Started logging epoch states to to: " <> logFile
where
handler :: FilePath -> AnyNewEpochState -> StateT () IO LedgerStateCondition
handler outputFp anyNewEpochState = handleException . liftIO $ do
handler :: FilePath -> AnyNewEpochState ->
SlotNo -> BlockNo -> StateT () IO LedgerStateCondition
handler outputFp anyNewEpochState _ _ = handleException . liftIO $ do
appendFile outputFp $ "#### BLOCK ####" <> "\n"
appendFile outputFp $ show anyNewEpochState <> "\n"
pure ConditionNotMet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ txOutValue (TxOut _ v _ _) = v
txOutValueLovelace ::TxOutValue era -> L.Coin
txOutValueLovelace = \case
TxOutValueShelleyBased sbe v -> v ^. A.adaAssetL sbe
TxOutValueByron (Lovelace v) -> L.Coin v
TxOutValueByron (L.Coin v) -> L.Coin v
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n

void $ evalEither eConstitutionAdopted


foldBlocksCheckProposalWasSubmitted
:: TxId -- TxId of submitted tx
-> Env
Expand Down Expand Up @@ -364,8 +365,9 @@ foldBlocksCheckConstitutionWasRatified
:: String -- submitted constitution hash
-> String -- submitted guard rail script hash
-> AnyNewEpochState
-> SlotNo -> BlockNo
-> StateT s IO LedgerStateCondition -- ^ Accumulator at block i and fold status
foldBlocksCheckConstitutionWasRatified submittedConstitutionHash submittedGuardRailScriptHash anyNewEpochState =
foldBlocksCheckConstitutionWasRatified submittedConstitutionHash submittedGuardRailScriptHash anyNewEpochState _ _ =
if filterRatificationState submittedConstitutionHash submittedGuardRailScriptHash anyNewEpochState
then return ConditionMet
else return ConditionNotMet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ getConstitutionProposal
-> m (Maybe (L.GovActionId StandardCrypto))
getConstitutionProposal nodeConfigFile socketPath maxEpoch = do
result <- runExceptT $ foldEpochState nodeConfigFile socketPath QuickValidation maxEpoch Nothing
$ \(AnyNewEpochState actualEra newEpochState) ->
$ \(AnyNewEpochState actualEra newEpochState) _ _ ->
caseShelleyToBabbageOrConwayEraOnwards
(error $ "Expected Conway era onwards, got state in " <> docToString (pretty actualEra))
(\cEra -> conwayEraOnwardsConstraints cEra $ do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ prop_check_if_treasury_is_growing = H.integrationRetryWorkspace 0 "growing-treas
H.note_ "treasury is not growing"
H.failure
where
handler :: AnyNewEpochState -> StateT (Map EpochNo Integer) IO LedgerStateCondition
handler (AnyNewEpochState _ newEpochState) = do
handler :: AnyNewEpochState -> SlotNo -> BlockNo -> StateT (Map EpochNo Integer) IO LedgerStateCondition
handler (AnyNewEpochState _ newEpochState) _ _ = do
let (Coin coin) = newEpochState ^. L.nesEsL . L.esAccountStateL . L.asTreasuryL
epochNo = newEpochState ^. L.nesELL
-- handler is executed multiple times per epoch, so we keep only the latest treasury value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ txOutValue (TxOut _ v _ _) = v
txOutValueLovelace ::TxOutValue era -> L.Coin
txOutValueLovelace = \case
TxOutValueShelleyBased sbe v -> v ^. A.adaAssetL sbe
TxOutValueByron (Lovelace v) -> L.Coin v
TxOutValueByron (L.Coin v) -> L.Coin v

0 comments on commit de0fd2c

Please sign in to comment.