Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 51 additions & 8 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2025-09-11T01:58:40Z
, hackage.haskell.org 2025-10-23T13:39:53Z
, cardano-haskell-packages 2025-10-21T11:16:53Z

packages:
Expand Down Expand Up @@ -55,12 +55,6 @@ write-ghc-environment-files: always
jobs: $ncpus
semaphore: True

if impl (ghc >= 9.12)
allow-newer:
-- https://github.com/kapralVV/Unique/issues/11
, Unique:hashable


-- WASM compilation specific

if arch(wasm32)
Expand Down Expand Up @@ -175,4 +169,53 @@ if arch(wasm32)

-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: 39904b54069934756a9f36dc8ace9d0aff36c738
--sha256: sha256-J7M7g8bPuEAI8zIP5KoHFbWTkm1IZIFYN8dtFAPIKg8=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger
tag: fb09078fa55015c881303a2ddb609c024cec258f
--sha256: sha256-9Y9CRiyMn0AWD+C4aNVMaJgrj3FDAYfCX4VrLvtoMaI=
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/alonzo/test-suite
eras/babbage/impl
eras/conway/impl
eras/dijkstra/impl
eras/mary/impl
eras/shelley/impl
eras/shelley/test-suite
eras/shelley-ma/test-suite
libs/cardano-ledger-api
libs/cardano-ledger-core
libs/cardano-ledger-binary
libs/cardano-protocol-tpraos
libs/non-integral
libs/small-steps
libs/cardano-data
libs/set-algebra
libs/vector-map
eras/byron/chain/executable-spec
eras/byron/ledger/executable-spec
eras/byron/ledger/impl
eras/byron/crypto

-- Backported version of https://github.com/IntersectMBO/ouroboros-network/pull/5161
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network
tag: 1385b53cefb81e79553b6b0252537455833ea9c4
--sha256: sha256-zZ7WsMfRs1fG16bmvI5vIh4fhQ8RGyEvYGLSWlrxpg0=
subdir:
ouroboros-network-api
ouroboros-network
14 changes: 7 additions & 7 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ library
cardano-ledger-binary >=1.6,
cardano-ledger-byron >=1.2,
cardano-ledger-conway >=1.19,
cardano-ledger-core >=1.17 && <1.19,
cardano-ledger-core >=1.17 && <1.20,
cardano-ledger-dijkstra >=0.1,
cardano-ledger-mary >=1.8,
cardano-ledger-shelley >=1.16,
Expand Down Expand Up @@ -169,8 +169,8 @@ library
ouroboros-network-framework,
ouroboros-network-protocols >=0.15,
parsec,
plutus-core ^>=1.53,
plutus-ledger-api ^>=1.53,
plutus-core ^>=1.53.1,
plutus-ledger-api ^>=1.53.1,
pretty-simple,
prettyprinter,
prettyprinter-ansi-terminal,
Expand Down Expand Up @@ -311,7 +311,7 @@ library gen

build-depends:
FailT,
QuickCheck <2.16,
QuickCheck,
aeson >=1.5.6.0,
base16-bytestring,
bytestring,
Expand Down Expand Up @@ -352,7 +352,7 @@ test-suite cardano-api-test
buildable: False
build-depends:
FailT,
QuickCheck <2.16,
QuickCheck,
aeson >=1.5.6.0,
base16-bytestring,
bytestring,
Expand Down Expand Up @@ -450,8 +450,8 @@ test-suite cardano-api-golden
hedgehog >=1.1,
hedgehog-extras ^>=0.10,
microlens,
plutus-core ^>=1.53,
plutus-ledger-api ^>=1.53,
plutus-core ^>=1.54,
plutus-ledger-api ^>=1.54,
tasty,
tasty-discover,
tasty-hedgehog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import Cardano.Binary
import Cardano.Crypto.Hash.Blake2b qualified as Blake2b
import Cardano.Crypto.Hash.Class qualified as C
import Cardano.Crypto.VRF qualified as C
import Cardano.Ledger.Allegra.Scripts qualified as L
import Cardano.Ledger.Alonzo.Plutus.Context qualified as Plutus
import Cardano.Ledger.Alonzo.Scripts qualified as L
import Cardano.Ledger.Alonzo.Tx qualified as L
Expand Down Expand Up @@ -107,11 +106,9 @@ type AlonzoEraOnwardsConstraints era =
, L.EraUTxO (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody
, L.MaryEraTxBody (ShelleyLedgerEra era)
, L.NativeScript (ShelleyLedgerEra era) ~ L.Timelock (ShelleyLedgerEra era)
, Plutus.EraPlutusContext (ShelleyLedgerEra era)
, L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era)
, L.ScriptsNeeded (ShelleyLedgerEra era) ~ L.AlonzoScriptsNeeded (ShelleyLedgerEra era)
, L.ShelleyEraTxCert (ShelleyLedgerEra era)
, L.Value (ShelleyLedgerEra era) ~ L.MaryValue
, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
Expand All @@ -131,7 +128,7 @@ alonzoEraOnwardsConstraints = \case
AlonzoEraOnwardsAlonzo -> id
AlonzoEraOnwardsBabbage -> id
AlonzoEraOnwardsConway -> id
AlonzoEraOnwardsDijkstra -> const $ error "alonzoEraOnwardsConstraints: Dijkstra era not yet supported"
AlonzoEraOnwardsDijkstra -> id

{-# DEPRECATED alonzoEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-}
alonzoEraOnwardsToShelleyBasedEra :: AlonzoEraOnwards era -> ShelleyBasedEra era
Expand Down
1 change: 0 additions & 1 deletion cardano-api/src/Cardano/Api/Experimental/Era.hs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ type EraCommonConstraints era =
, L.EraTxOut (LedgerEra era)
, L.EraUTxO (LedgerEra era)
, FromCBOR (ChainDepState (ConsensusProtocol era))
, L.NativeScript (LedgerEra era) ~ L.Timelock (LedgerEra era)
, PraosProtocolSupportsNode (ConsensusProtocol era)
, ShelleyLedgerEra era ~ LedgerEra era
, ToJSON (ChainDepState (ConsensusProtocol era))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import Cardano.Binary qualified as CBOR
import Cardano.Ledger.Alonzo.Scripts qualified as L
import Cardano.Ledger.BaseTypes (Version)
import Cardano.Ledger.Core qualified as L
import Cardano.Ledger.Dijkstra.Scripts qualified as Dijkstra
import Cardano.Ledger.Plutus.Language qualified as L

import Data.Text qualified as Text
Expand Down Expand Up @@ -96,7 +97,11 @@ convertToNewScriptWitness eon (Old.SimpleScriptWitness _ scriptOrRefInput) witne

convertTotimelock
:: AlonzoEraOnwards era -> Old.SimpleScript -> L.NativeScript (ShelleyLedgerEra era)
convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ Old.toAllegraTimelock s
convertTotimelock eon s = alonzoEraOnwardsConstraints eon $ case eon of
AlonzoEraOnwardsAlonzo -> Old.toAllegraTimelock s
AlonzoEraOnwardsBabbage -> Old.toAllegraTimelock s
AlonzoEraOnwardsConway -> Old.toAllegraTimelock s
AlonzoEraOnwardsDijkstra -> Dijkstra.upgradeTimelock (Old.toAllegraTimelock s)

createPlutusScriptDatum
:: Witnessable thing era
Expand Down
4 changes: 3 additions & 1 deletion cardano-api/src/Cardano/Api/LedgerState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wno-x-ord-preserving-coercions #-}

module Cardano.Api.LedgerState
( -- * Initialization / Accumulation
Expand Down Expand Up @@ -207,6 +208,7 @@ import Ouroboros.Consensus.Shelley.HFEras qualified as Shelley
import Ouroboros.Consensus.Shelley.Ledger.Block qualified as Shelley
import Ouroboros.Consensus.Shelley.Ledger.Ledger qualified as Shelley
import Ouroboros.Consensus.TypeFamilyWrappers (WrapLedgerEvent (WrapLedgerEvent))
import Ouroboros.Consensus.Util (coerceMapKeys)
import Ouroboros.Network.Block (blockNo)
import Ouroboros.Network.Block qualified
import Ouroboros.Network.Protocol.ChainSync.Client qualified as CS
Expand Down Expand Up @@ -2285,7 +2287,7 @@ getLedgerTablesUTxOValues sbe tbs =
-> Map TxIn (TxOut CtxUTxO era)
ejectTables idx =
let Consensus.LedgerTables (Ledger.ValuesMK values) = HFC.ejectLedgerTables idx tbs
in Map.mapKeys fromShelleyTxIn $ Map.map (fromShelleyTxOut sbe) values
in Map.mapKeys fromShelleyTxIn $ coerceMapKeys $ Map.map (fromShelleyTxOut sbe) values
in
case sbe of
ShelleyBasedEraShelley -> ejectTables (IS IZ)
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ toShelleyScript (ScriptInEra langInEra (SimpleScript script)) =
SimpleScriptInAlonzo -> Alonzo.NativeScript (toAllegraTimelock script)
SimpleScriptInBabbage -> Alonzo.NativeScript (toAllegraTimelock script)
SimpleScriptInConway -> Alonzo.NativeScript (toAllegraTimelock script)
SimpleScriptInDijkstra -> Alonzo.NativeScript (toAllegraTimelock script)
SimpleScriptInDijkstra -> Alonzo.NativeScript (Dijkstra.upgradeTimelock (toAllegraTimelock script))
toShelleyScript
( ScriptInEra
langInEra
Expand Down
Loading