Skip to content

Commit

Permalink
Move Cardano.Ledger.Alonzo.Tools into cardano-ledger-api
Browse files Browse the repository at this point in the history
Also export missing error types and type synonyms
  • Loading branch information
lehins committed Mar 16, 2023
1 parent a433ff3 commit 1048859
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 22 deletions.
1 change: 1 addition & 0 deletions eras/alonzo/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Add `ToJSON` instance for `AlonzoPParams StrictMaybe`
* Stop exporting an internal function `decodeBinaryData`
* Remove redundant `Redeemers'` pattern synonym.
* Move `Cardano.Ledger.Alonzo.Tools` module into `cardano-ledger-api:Cardano.Ledger.Api.Scripts`

###`testlib`

Expand Down
2 changes: 0 additions & 2 deletions eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ library
Cardano.Ledger.Alonzo.Rules
Cardano.Ledger.Alonzo.Scripts
Cardano.Ledger.Alonzo.Scripts.Data
Cardano.Ledger.Alonzo.Tools
Cardano.Ledger.Alonzo.Translation
Cardano.Ledger.Alonzo.Tx
Cardano.Ledger.Alonzo.TxAuxData
Expand Down Expand Up @@ -60,7 +59,6 @@ library
build-depends:
base >=4.14 && <4.17,
aeson >=2,
array,
base-deriving-via,
base64-bytestring,
bytestring,
Expand Down
3 changes: 2 additions & 1 deletion libs/cardano-ledger-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
* And protocol version related functionality: `eraProtVerHigh`, `eraProtVerLow`,
`AtLeastEra`, `AtMostEra`, `ExactEra`, `ProtVerAtLeast`, `ProtVerAtMost`,
`ProtVerInBounds`, `atLeastEra` and `atMostEra`

* Move `Cardano.Ledger.Alonzo.Tools` module from `cardano-ledegr-alonzo` into
`Cardano.Ledger.Api.Scripts`

## 1.0.0.0

Expand Down
8 changes: 7 additions & 1 deletion libs/cardano-ledger-api/cardano-ledger-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ library
Cardano.Ledger.Api.UTxO

hs-source-dirs: src
other-modules: Cardano.Ledger.Api.Scripts.Tools
default-language: Haskell2010
ghc-options:
-Wall -Wcompat -Wincomplete-record-updates
Expand All @@ -45,6 +46,7 @@ library

build-depends:
base >=4.14 && <4.17,
array,
bytestring,
cardano-ledger-allegra >=1.1,
cardano-ledger-alonzo >=1.1,
Expand All @@ -54,7 +56,11 @@ library
cardano-ledger-core >=1.0,
cardano-ledger-mary >=1.1,
cardano-ledger-shelley >=1.1,
microlens
cardano-slotting,
containers,
microlens,
plutus-ledger-api,
text

test-suite cardano-ledger-api-test
type: exitcode-stdio-1.0
Expand Down
4 changes: 4 additions & 0 deletions libs/cardano-ledger-api/src/Cardano/Ledger/Api/Scripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ module Cardano.Ledger.Api.Scripts (
ScriptHash,
CostModels (..),
ValidityInterval (..),

-- * Tools
module Cardano.Ledger.Api.Scripts.Tools,
)
where

import Cardano.Ledger.Allegra.Scripts (ValidityInterval (..))
import Cardano.Ledger.Alonzo.Scripts (CostModels (..))
import Cardano.Ledger.Api.Era ()
import Cardano.Ledger.Api.Scripts.Data
import Cardano.Ledger.Api.Scripts.Tools
import Cardano.Ledger.Core (EraScript (..))
import Cardano.Ledger.Hashes (ScriptHash)
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}

module Cardano.Ledger.Alonzo.Tools (
module Cardano.Ledger.Api.Scripts.Tools (
TransactionScriptFailure (..),
ValidationFailed (..),
evaluateTransactionExecutionUnits,
RedeemerReport,
evaluateTransactionExecutionUnitsWithLogs,
TransactionScriptFailure (..),
RedeemerReportWithLogs,
)
where

Expand Down
31 changes: 16 additions & 15 deletions libs/cardano-ledger-test/cardano-ledger-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,22 @@ library
array,
bytestring,
cardano-crypto-class,
cardano-ledger-allegra >=1.1,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.1,
cardano-ledger-alonzo-test >=1.1,
cardano-ledger-babbage:{cardano-ledger-babbage, testlib} >=1.1,
cardano-ledger-babbage-test >=1.1,
cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0,
cardano-ledger-conway:{cardano-ledger-conway, testlib} >=1.1,
cardano-ledger-conway-test >=1.1,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.0,
cardano-ledger-pretty >=1.0,
cardano-ledger-mary >=1.1,
cardano-ledger-shelley >=1.1,
cardano-ledger-shelley-test >=1.1,
cardano-ledger-shelley-ma-test >=1.1,
cardano-protocol-tpraos >=1.0,
cardano-ledger-allegra,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib},
cardano-ledger-alonzo-test,
cardano-ledger-api,
cardano-ledger-babbage:{cardano-ledger-babbage, testlib},
cardano-ledger-babbage-test,
cardano-ledger-binary:{cardano-ledger-binary, testlib},
cardano-ledger-conway:{cardano-ledger-conway, testlib},
cardano-ledger-conway-test,
cardano-ledger-core:{cardano-ledger-core, testlib},
cardano-ledger-pretty,
cardano-ledger-mary,
cardano-ledger-shelley,
cardano-ledger-shelley-test,
cardano-ledger-shelley-ma-test,
cardano-protocol-tpraos,
cardano-slotting,
containers,
vector-map,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import Cardano.Ledger.Alonzo.Language (Language (..))
import Cardano.Ledger.Alonzo.Scripts (AlonzoScript, CostModel, ExUnits (..), Tag (..))
import qualified Cardano.Ledger.Alonzo.Scripts as Tag
import Cardano.Ledger.Alonzo.Scripts.Data (Data (..))
import Cardano.Ledger.Alonzo.Tools (TransactionScriptFailure (..), evaluateTransactionExecutionUnits)
import Cardano.Ledger.Alonzo.Tx (AlonzoEraTx (..))
import Cardano.Ledger.Alonzo.TxInfo (ExtendedUTxO, exBudgetToExUnits, transExUnits)
import Cardano.Ledger.Alonzo.TxWits
import Cardano.Ledger.Alonzo.UTxO (AlonzoScriptsNeeded)
import Cardano.Ledger.Api.Scripts (TransactionScriptFailure (..), evaluateTransactionExecutionUnits)
import Cardano.Ledger.BaseTypes (ProtVer (..), ShelleyBase, natVersion)
import Cardano.Ledger.Coin (Coin (..))
import Cardano.Ledger.Crypto
Expand Down

0 comments on commit 1048859

Please sign in to comment.