Skip to content

Commit dbf7a68

Browse files
committed
Fix compilation errors in cardano-api
1 parent 5694c32 commit dbf7a68

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import Cardano.Binary
2929
import Cardano.Crypto.Hash.Blake2b qualified as Blake2b
3030
import Cardano.Crypto.Hash.Class qualified as C
3131
import Cardano.Crypto.VRF qualified as C
32-
import Cardano.Ledger.Allegra.Scripts qualified as L
3332
import Cardano.Ledger.Alonzo.Plutus.Context qualified as Plutus
3433
import Cardano.Ledger.Alonzo.Scripts qualified as L
3534
import Cardano.Ledger.Alonzo.Tx qualified as L
@@ -107,7 +106,6 @@ type AlonzoEraOnwardsConstraints era =
107106
, L.EraUTxO (ShelleyLedgerEra era)
108107
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody
109108
, L.MaryEraTxBody (ShelleyLedgerEra era)
110-
, L.NativeScript (ShelleyLedgerEra era) ~ L.Timelock (ShelleyLedgerEra era)
111109
, Plutus.EraPlutusContext (ShelleyLedgerEra era)
112110
, L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era)
113111
, L.ScriptsNeeded (ShelleyLedgerEra era) ~ L.AlonzoScriptsNeeded (ShelleyLedgerEra era)

cardano-api/src/Cardano/Api/Experimental/Era.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ type EraCommonConstraints era =
311311
, L.EraUTxO (LedgerEra era)
312312
, L.Value (LedgerEra era) ~ L.MaryValue
313313
, FromCBOR (ChainDepState (ConsensusProtocol era))
314-
, L.NativeScript (LedgerEra era) ~ L.Timelock (LedgerEra era)
315314
, PraosProtocolSupportsNode (ConsensusProtocol era)
316315
, ShelleyLedgerEra era ~ LedgerEra era
317316
, ToJSON (ChainDepState (ConsensusProtocol era))

cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Cardano.Binary qualified as CBOR
3737
import Cardano.Ledger.Alonzo.Scripts qualified as L
3838
import Cardano.Ledger.BaseTypes (Version)
3939
import Cardano.Ledger.Core qualified as L
40+
import Cardano.Ledger.Dijkstra.Scripts (upgradeTimelock)
4041
import Cardano.Ledger.Plutus.Language qualified as L
4142

4243
import Data.Text qualified as Text
@@ -96,7 +97,12 @@ convertToNewScriptWitness eon (Old.SimpleScriptWitness _ scriptOrRefInput) witne
9697

9798
convertTotimelock
9899
:: AlonzoEraOnwards era -> Old.SimpleScript -> L.NativeScript (ShelleyLedgerEra era)
99-
convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s
100+
convertTotimelock eon s =
101+
case eon of
102+
AlonzoEraOnwardsAlonzo -> alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s
103+
AlonzoEraOnwardsBabbage -> alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s
104+
AlonzoEraOnwardsConway -> alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s
105+
AlonzoEraOnwardsDijkstra -> upgradeTimelock $ alonzoEraOnwardsConstraints AlonzoEraOnwardsConway $ Old.toAllegraTimelock s
100106

101107
createPlutusScriptDatum
102108
:: Witnessable thing era

cardano-api/src/Cardano/Api/LedgerState.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ getLedgerTablesUTxOValues sbe tbs =
22862286
-> Map TxIn (TxOut CtxUTxO era)
22872287
ejectTables idx =
22882288
let Consensus.LedgerTables (Ledger.ValuesMK values) = HFC.ejectLedgerTables idx tbs
2289-
in Map.mapKeys fromShelleyTxIn $ Map.map (fromShelleyTxOut sbe) values
2289+
in Map.mapKeys (fromShelleyTxIn . Shelley.getOriginalTxIn) $ Map.map (fromShelleyTxOut sbe) values
22902290
in
22912291
case sbe of
22922292
ShelleyBasedEraShelley -> ejectTables (IS IZ)

cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ import Cardano.Ledger.BaseTypes (StrictMaybe (..))
147147
import Cardano.Ledger.Binary qualified as Binary (decCBOR, decodeFullAnnotator)
148148
import Cardano.Ledger.Conway.Scripts qualified as Conway
149149
import Cardano.Ledger.Core qualified as Ledger
150+
import Cardano.Ledger.Dijkstra.Scripts (upgradeTimelock)
150151
import Cardano.Ledger.Dijkstra.Scripts qualified as Dijkstra
151152
import Cardano.Ledger.Keys qualified as Shelley
152153
import Cardano.Ledger.Plutus.Language qualified as Plutus
@@ -1242,7 +1243,7 @@ toShelleyScript (ScriptInEra langInEra (SimpleScript script)) =
12421243
SimpleScriptInAlonzo -> Alonzo.NativeScript (toAllegraTimelock script)
12431244
SimpleScriptInBabbage -> Alonzo.NativeScript (toAllegraTimelock script)
12441245
SimpleScriptInConway -> Alonzo.NativeScript (toAllegraTimelock script)
1245-
SimpleScriptInDijkstra -> Alonzo.NativeScript (toAllegraTimelock script)
1246+
SimpleScriptInDijkstra -> Alonzo.NativeScript (upgradeTimelock $ toAllegraTimelock script)
12461247
toShelleyScript
12471248
( ScriptInEra
12481249
langInEra

0 commit comments

Comments
 (0)