Skip to content

Commit

Permalink
Merge pull request #1321 from input-output-hk/lc/conway-smoke-test
Browse files Browse the repository at this point in the history
Support Conway smoke test
  • Loading branch information
locallycompact authored Feb 24, 2024
2 parents f617912 + c118258 commit 163aef7
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions hydra-node/src/Hydra/Chain/CardanoClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,10 @@ queryEpochNo ::
QueryPoint ->
IO EpochNo
queryEpochNo networkId socket queryPoint = do
let query =
QueryInEra
( QueryInShelleyBasedEra
ShelleyBasedEraBabbage
QueryEpoch
)
runQuery networkId socket queryPoint query >>= throwOnEraMismatch
runQueryExpr networkId socket queryPoint $ do
(AnyCardanoEra era) <- queryCurrentEraExpr
(sbe :: ShelleyBasedEra e) <- liftIO $ assumeShelleyBasedEraOrThrow era
queryInShelleyBasedEraExpr sbe QueryEpoch

-- | Query the protocol parameters at given point.
--
Expand Down Expand Up @@ -362,14 +359,12 @@ queryUTxOWhole ::
SocketPath ->
QueryPoint ->
IO UTxO
queryUTxOWhole networkId socket queryPoint = UTxO.fromApi <$> (runQuery networkId socket queryPoint query >>= throwOnEraMismatch)
where
query =
QueryInEra
( QueryInShelleyBasedEra
ShelleyBasedEraBabbage
(QueryUTxO QueryUTxOWhole)
)
queryUTxOWhole networkId socket queryPoint = do
runQueryExpr networkId socket queryPoint $ do
(AnyCardanoEra era) <- queryCurrentEraExpr
(sbe :: ShelleyBasedEra e) <- liftIO $ assumeShelleyBasedEraOrThrow era
eraUTxO <- queryInShelleyBasedEraExpr sbe $ QueryUTxO QueryUTxOWhole
pure $ UTxO.fromApi eraUTxO

-- | Query UTxO for the address of given verification key at point.
--
Expand All @@ -393,13 +388,10 @@ queryStakePools ::
QueryPoint ->
IO (Set PoolId)
queryStakePools networkId socket queryPoint =
let query =
QueryInEra
( QueryInShelleyBasedEra
ShelleyBasedEraBabbage
QueryStakePools
)
in runQuery networkId socket queryPoint query >>= throwOnEraMismatch
runQueryExpr networkId socket queryPoint $ do
(AnyCardanoEra era) <- queryCurrentEraExpr
(sbe :: ShelleyBasedEra e) <- liftIO $ assumeShelleyBasedEraOrThrow era
queryInShelleyBasedEraExpr sbe QueryStakePools

-- * Helpers

Expand Down

0 comments on commit 163aef7

Please sign in to comment.