Skip to content

Commit

Permalink
Era = ConwayEra
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Mar 5, 2024
1 parent 6fcc456 commit 6b06a83
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions hydra-cardano-api/hydra-cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ library
, cardano-ledger-alonzo >=1.6 && <1.7
, cardano-ledger-api >=1.8 && <1.9
, cardano-ledger-babbage >=1.6 && <1.7
, cardano-ledger-conway >=1.12 && <1.13
, cardano-ledger-binary >=1.3 && <1.4
, cardano-ledger-byron >=1.0.0 && <1.1
, cardano-ledger-core >=1.10 && <1.11
Expand Down
2 changes: 1 addition & 1 deletion hydra-cardano-api/src/Cardano/Api/UTxO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Hydra.Cardano.Api.BabbageEraOnwards (IsBabbageEraOnwards (..))
import Hydra.Cardano.Api.MaryEraOnwards (IsMaryEraOnwards (..))
import Prelude

type Era = BabbageEra
type Era = ConwayEra

type UTxO = UTxO' (TxOut CtxUTxO Era)

Expand Down
8 changes: 4 additions & 4 deletions hydra-cardano-api/src/Hydra/Cardano/Api/PlutusScript.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Hydra.Cardano.Api.PlutusScript where
import Hydra.Cardano.Api.Prelude

import Cardano.Ledger.Alonzo.Scripts qualified as Ledger
import Cardano.Ledger.Babbage.Scripts qualified as Ledger
import Cardano.Ledger.Conway.Scripts qualified as Ledger
import Cardano.Ledger.Plutus.Language qualified as Ledger
import Data.ByteString.Short qualified as SBS
import PlutusLedgerApi.Common qualified as Plutus
Expand Down Expand Up @@ -37,9 +37,9 @@ toLedgerScript ::
Ledger.AlonzoScript (ShelleyLedgerEra Era)
toLedgerScript (PlutusScriptSerialised bytes) =
Ledger.PlutusScript $ case plutusScriptVersion @lang of
PlutusScriptV1 -> Ledger.BabbagePlutusV1 $ Ledger.Plutus (Ledger.PlutusBinary bytes)
PlutusScriptV2 -> Ledger.BabbagePlutusV2 $ Ledger.Plutus (Ledger.PlutusBinary bytes)
PlutusScriptV3 -> error "toLedgerScript: PlutusV3 not supported in Babbage"
PlutusScriptV1 -> Ledger.ConwayPlutusV1 $ Ledger.Plutus (Ledger.PlutusBinary bytes)
PlutusScriptV2 -> Ledger.ConwayPlutusV2 $ Ledger.Plutus (Ledger.PlutusBinary bytes)
PlutusScriptV3 -> Ledger.ConwayPlutusV3 $ Ledger.Plutus (Ledger.PlutusBinary bytes)

-- | Convert a serialized plutus script into a cardano-api 'PlutusScript'.
fromPlutusScript :: Plutus.SerialisedScript -> PlutusScript lang
Expand Down
2 changes: 1 addition & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import Data.Typeable (Typeable)
import GHC.Stack (HasCallStack)
import Test.QuickCheck (Arbitrary (..), Gen)

type Era = BabbageEra
type Era = ConwayEra

-- | Currently supported ledger era.
type LedgerEra = ShelleyLedgerEra Era
Expand Down
6 changes: 3 additions & 3 deletions hydra-cardano-api/src/Hydra/Cardano/Api/TxBody.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Hydra.Cardano.Api.TxBody where
import Hydra.Cardano.Api.Prelude

import Cardano.Ledger.Alonzo.TxWits qualified as Ledger
import Cardano.Ledger.Api (AlonzoPlutusPurpose (..), AsIndex, AsItem (..), PlutusPurpose)
import Cardano.Ledger.Api (AsIndex, AsItem (..), PlutusPurpose, ConwayPlutusPurpose (..))
import Cardano.Ledger.Babbage.Core (redeemerPointer)
import Cardano.Ledger.BaseTypes (strictMaybeToMaybe)
import Cardano.Ledger.Core qualified as Ledger
Expand All @@ -23,7 +23,7 @@ findRedeemerSpending ::
TxIn ->
Maybe a
findRedeemerSpending (getTxBody -> ShelleyTxBody _ body _ scriptData _ _) txIn = do
ptr <- strictMaybeToMaybe $ redeemerPointer body (AlonzoSpending . AsItem $ toLedgerTxIn txIn)
ptr <- strictMaybeToMaybe $ redeemerPointer body (ConwaySpending . AsItem $ toLedgerTxIn txIn)
lookupRedeemer ptr scriptData

findRedeemerMinting ::
Expand All @@ -32,7 +32,7 @@ findRedeemerMinting ::
PolicyId ->
Maybe a
findRedeemerMinting (getTxBody -> ShelleyTxBody _ body _ scriptData _ _) pid = do
ptr <- strictMaybeToMaybe $ redeemerPointer body (AlonzoMinting . AsItem $ toLedgerPolicyID pid)
ptr <- strictMaybeToMaybe $ redeemerPointer body (ConwayMinting . AsItem $ toLedgerPolicyID pid)
lookupRedeemer ptr scriptData

findScriptMinting ::
Expand Down
1 change: 1 addition & 0 deletions hydra-node/hydra-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ library
, cardano-ledger-api
, cardano-ledger-babbage:{cardano-ledger-babbage, testlib}
, cardano-ledger-binary
, cardano-ledger-conway:{cardano-ledger-conway, testlib}
, cardano-ledger-core
, cardano-ledger-shelley
, cardano-slotting
Expand Down
4 changes: 2 additions & 2 deletions hydra-node/src/Hydra/Chain/CardanoClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ queryProtocolParameters networkId socket queryPoint =
AllegraEra -> encodeToEra AllegraEra pparams
MaryEra -> encodeToEra MaryEra pparams
AlonzoEra -> encodeToEra AlonzoEra pparams
BabbageEra -> pure pparams
ConwayEra -> encodeToEra ConwayEra pparams
BabbageEra -> encodeToEra BabbageEra pparams
ConwayEra -> pure pparams

-- | Query 'GenesisParameters' at a given point.
--
Expand Down

0 comments on commit 6b06a83

Please sign in to comment.