Skip to content

Commit

Permalink
Merge pull request #3848 from input-output-hk/lehins/plutus-module-re…
Browse files Browse the repository at this point in the history
…structure

Plutus modules restructure
  • Loading branch information
lehins authored Nov 7, 2023
2 parents 45f8572 + ec96724 commit acf35f3
Show file tree
Hide file tree
Showing 117 changed files with 2,507 additions and 2,221 deletions.
6 changes: 6 additions & 0 deletions eras/alonzo/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## 1.5.1.0

* Move `Cardano.Ledger.Alonzo.Scripts.Data` to `Cardano.Ledger.Plutus.Data`
* Deprecated `Cardano.Ledger.Alonzo.Language`
* Move `Cardano.Ledger.Alonzo.TxInfo` to `Cardano.Ledger.Alonzo.Plutus.TxInfo` with
deprecation of the former.
* Add `evalScriptsWithLogs`, `evalPlutusScriptsWithLogs` and `runPlutusScriptWithLogs`: #3843

### `testlib`

* Provide CDDL spec files with `readAlonzoCddlFileNames` and `readAlonzoCddlFiles` from
Expand Down
13 changes: 2 additions & 11 deletions eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ library
Cardano.Ledger.Alonzo.Transition
Cardano.Ledger.Alonzo.Genesis
Cardano.Ledger.Alonzo.Language
Cardano.Ledger.Alonzo.Plutus.TxInfo
Cardano.Ledger.Alonzo.PlutusScriptApi
Cardano.Ledger.Alonzo.PParams
Cardano.Ledger.Alonzo.Rules
Expand Down Expand Up @@ -66,39 +67,29 @@ library
build-depends:
base >=4.14 && <4.19,
aeson >=2.2,
base-deriving-via,
base64-bytestring,
bytestring,
cardano-data >=1.0,
cardano-ledger-allegra >=1.1,
cardano-crypto-class,
cardano-ledger-binary >=1.0.1,
cardano-ledger-core >=1.8 && <1.9,
cardano-ledger-core >=1.8.1 && <1.9,
cardano-ledger-mary >=1.1,
cardano-ledger-shelley >=1.7 && <1.9,
cardano-slotting,
cardano-strict-containers,
containers,
data-default-class,
deepseq,
FailT,
heapwords,
measures,
mtl,
microlens,
nothunks,
plutus-ledger-api ^>=1.15,
plutus-core ^>=1.15,
prettyprinter,
serialise,
set-algebra >=1.0,
scientific,
small-steps >=1.0,
text,
time,
transformers,
tree-diff,
utf8-string,
validation-selective

if !impl(ghc >=9.2)
Expand Down
8 changes: 2 additions & 6 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ where
import Cardano.Ledger.Alonzo.Era
import Cardano.Ledger.Alonzo.Genesis
import Cardano.Ledger.Alonzo.PParams ()
import Cardano.Ledger.Alonzo.Plutus.TxInfo (ExtendedUTxO (..), alonzoTxInfo)
import Cardano.Ledger.Alonzo.Rules ()
import Cardano.Ledger.Alonzo.Scripts (AlonzoScript (..))
import Cardano.Ledger.Alonzo.Scripts.Data ()
import Cardano.Ledger.Alonzo.Transition ()
import Cardano.Ledger.Alonzo.Translation ()
import Cardano.Ledger.Alonzo.Tx ()
import Cardano.Ledger.Alonzo.TxAuxData (AlonzoTxAuxData)
import Cardano.Ledger.Alonzo.TxBody (AlonzoTxBody, AlonzoTxOut)
import Cardano.Ledger.Alonzo.TxInfo (ExtendedUTxO (..), alonzoTxInfo)
import Cardano.Ledger.Alonzo.TxWits ()
import Cardano.Ledger.Alonzo.UTxO ()
import Cardano.Ledger.BaseTypes (Globals)
import Cardano.Ledger.Core
import Cardano.Ledger.Crypto (Crypto, StandardCrypto)
import Cardano.Ledger.Keys (DSignable, Hash)
import Cardano.Ledger.Mary.Value (MaryValue)
import Cardano.Ledger.Plutus.Data ()
import Cardano.Ledger.Rules.ValidationMode (applySTSNonStatic)
import qualified Cardano.Ledger.Shelley.API as API
import Cardano.Ledger.Shelley.API.Mempool
Expand Down Expand Up @@ -74,10 +74,6 @@ instance (Crypto c, DSignable c (Hash c EraIndependentTxBody)) => API.ApplyTx (A

instance (Crypto c, DSignable c (Hash c EraIndependentTxBody)) => API.ApplyBlock (AlonzoEra c)

-- To run a PlutusScript use Cardano.Ledger.Alonzo.TxInfo(runPLCScript)
-- To run any Alonzo Script use Cardano.Ledger.Alonzo.PlutusScriptApi(evalScripts)
-- hashScript x = ... We use the default method for hashScript

instance Crypto c => API.CanStartFromGenesis (AlonzoEra c) where
type AdditionalGenesisConfig (AlonzoEra c) = AlonzoGenesis
fromShelleyPParams ag = translateEra' ag . API.fromShelleyPParams ()
Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ where

import Cardano.Ledger.Alonzo.Era (AlonzoEra)
import Cardano.Ledger.Alonzo.Scripts (CostModels, ExUnits, Prices)
import Cardano.Ledger.Alonzo.Scripts.Data (Datum)
import Cardano.Ledger.BaseTypes (Network)
import Cardano.Ledger.Binary (DecCBOR, EncCBOR)
import Cardano.Ledger.Coin (Coin (Coin))
import Cardano.Ledger.HKD (HKD, HKDFunctor)
import Cardano.Ledger.Hashes
import Cardano.Ledger.Keys (KeyHash (..), KeyRole (..))
import Cardano.Ledger.Mary.Core
import Cardano.Ledger.Plutus.Data (Datum)
import Cardano.Ledger.SafeHash (SafeHash)
import Cardano.Ledger.TxIn (TxIn (..))
import Control.DeepSeq (NFData)
Expand Down
4 changes: 2 additions & 2 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Data.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Cardano.Ledger.Alonzo.Data
{-# DEPRECATED "This module has been split into two `Cardano.Ledger.Alonzo.TxAuxData` and `Cardano.Ledger.Alonzo.Scripts.Data`" #-} (
{-# DEPRECATED "This module has been split into two \"Cardano.Ledger.Alonzo.TxAuxData\" and \"Cardano.Ledger.Plutus.Data\"" #-} (
module X,
)
where

import Cardano.Ledger.Alonzo.Scripts.Data as X
import Cardano.Ledger.Alonzo.TxAuxData as X
import Cardano.Ledger.Plutus.Data as X
11 changes: 4 additions & 7 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Language.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
module Cardano.Ledger.Alonzo.Language
{-# DEPRECATED "Use \"Cardano.Ledger.Plutus.Language\" instead" #-}
(module Cardano.Ledger.Plutus.Language) where

-- | This module exports the module Cardano.Ledger.Language. That module exports data
-- structures and operations for talking about Non-native Script languages. It is expected that new languages (or new
-- versions of old languages) will be added there, and just imported here.
module Cardano.Ledger.Alonzo.Language (module Cardano.Ledger.Language) where

import Cardano.Ledger.Language
import Cardano.Ledger.Plutus.Language
2 changes: 1 addition & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PParams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ import Cardano.Ledger.Binary.Coders (
import Cardano.Ledger.Coin (Coin (..))
import Cardano.Ledger.Crypto (Crypto)
import Cardano.Ledger.HKD (HKD, HKDFunctor (..))
import Cardano.Ledger.Language (Language (..))
import Cardano.Ledger.Orphans ()
import Cardano.Ledger.Plutus.Language (Language (..))
import Cardano.Ledger.Shelley.PParams (
ShelleyPParams (..),
emptyPPPUpdates,
Expand Down
Loading

0 comments on commit acf35f3

Please sign in to comment.