Skip to content

Commit

Permalink
bumped and builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Dec 18, 2023
1 parent 046eb48 commit 7f246bb
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 106 deletions.
57 changes: 50 additions & 7 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ 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 2023-11-20T23:52:53Z
, cardano-haskell-packages 2023-11-30T12:34:51Z
, hackage.haskell.org 2023-12-14T23:57:38Z
, cardano-haskell-packages 2023-12-15T13:03:00Z

packages:
cardano-api
cardano-api-gen

package cardano-api
ghc-options: -Werror

package cardano-api-gen
ghc-options: -Werror
-- package cardano-api
-- ghc-options: -Werror
--
-- package cardano-api-gen
-- ghc-options: -Werror

package cryptonite
-- Using RDRAND instead of /dev/urandom as an entropy source for key
Expand All @@ -41,3 +41,46 @@ write-ghc-environment-files: always
-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 0765d327dfb01e1a8dfc34b7619294cd504474e7
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/alonzo/test-suite
eras/babbage/impl
eras/babbage/test-suite
eras/byron/ledger/impl
eras/conway/impl
eras/conway/test-suite
eras/mary/impl
eras/shelley/impl
eras/shelley/test-suite
eras/shelley-ma/test-suite
libs/cardano-data
libs/cardano-ledger-api
libs/cardano-ledger-binary
libs/cardano-ledger-core
libs/cardano-ledger-pretty
libs/small-steps
libs/small-steps-test
libs/vector-map

source-repository-package
type: git
location: https://github.com/zliu41/ouroboros-consensus.git
tag: ffdc49fa891e180101ecfd8567ac844fe6c581eb
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-protocol
ouroboros-consensus-diffusion
sop-extras
strict-sop-core

source-repository-package
type: git
location: https://github.com/input-output-hk/hedgehog-extras.git
tag: 4361be5acd92d1a2f7d4bd5bd6cbd78145e1c930
22 changes: 11 additions & 11 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ library internal
, cardano-crypto-class ^>= 2.1.2
, cardano-crypto-wrapper ^>= 1.5
, cardano-data >= 1.0
, cardano-ledger-alonzo >= 1.5.0
, cardano-ledger-alonzo >= 1.6.0
, cardano-ledger-allegra >= 1.2.3.1
, cardano-ledger-api ^>= 1.7
, cardano-ledger-babbage >= 1.5.0
, cardano-ledger-api ^>= 1.8
, cardano-ledger-babbage >= 1.6.0
, cardano-ledger-binary
, cardano-ledger-byron >= 1.0.0.2
, cardano-ledger-conway >= 1.10.0
Expand Down Expand Up @@ -198,10 +198,10 @@ library internal
, ouroboros-network-framework
, ouroboros-network-protocols
, parsec
, plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>= 1.15
, plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>= 1.18
, prettyprinter
, prettyprinter-ansi-terminal
, prettyprinter-configurable ^>= 1.15
, prettyprinter-configurable ^>= 1.18
, random
, scientific
, serialise
Expand Down Expand Up @@ -277,7 +277,7 @@ library gen
, cardano-binary >= 1.6 && < 1.8
, cardano-crypto-class ^>= 2.1.2
, cardano-crypto-test ^>= 1.5
, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >= 1.5.0
, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >= 1.6.0
, cardano-ledger-byron-test >= 1.5
, cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.8.0
, cardano-ledger-shelley >= 1.7.0
Expand Down Expand Up @@ -307,7 +307,7 @@ test-suite cardano-api-test
, cardano-crypto-class ^>= 2.1.2
, cardano-crypto-test ^>= 1.5
, cardano-crypto-tests ^>= 2.1
, cardano-ledger-api ^>= 1.7
, cardano-ledger-api ^>= 1.8
, cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.8
, containers
, directory
Expand Down Expand Up @@ -356,7 +356,7 @@ test-suite cardano-api-golden
, cardano-crypto-class ^>= 2.1.2
, cardano-data >= 1.0
, cardano-ledger-alonzo
, cardano-ledger-api ^>= 1.7
, cardano-ledger-api ^>= 1.8
, cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.8
, cardano-ledger-shelley
, cardano-ledger-shelley-test >= 1.2.0.1
Expand All @@ -365,11 +365,11 @@ test-suite cardano-api-golden
, errors
, filepath
, hedgehog >= 1.1
, hedgehog-extras ^>= 0.4.7.0
, hedgehog-extras ^>= 0.5.0.0
, microlens
, parsec
, plutus-core ^>= 1.15
, plutus-ledger-api ^>= 1.15
, plutus-core ^>= 1.18
, plutus-ledger-api ^>= 1.18
, tasty
, tasty-hedgehog
, time
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Address.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ import Cardano.Api.Utils

import qualified Cardano.Chain.Common as Byron
import qualified Cardano.Ledger.Address as Shelley
import qualified Cardano.Ledger.Alonzo.Plutus.TxInfo as Plutus
import qualified Cardano.Ledger.BaseTypes as Shelley
import qualified Cardano.Ledger.Credential as Shelley
import Cardano.Ledger.Crypto (StandardCrypto)
import qualified Cardano.Ledger.Plutus.TxInfo as Plutus
import qualified PlutusLedgerApi.V1 as PlutusAPI

import Control.Applicative ((<|>))
Expand Down
2 changes: 0 additions & 2 deletions cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ type AlonzoEraOnwardsConstraints era =
, L.Crypto (L.EraCrypto (ShelleyLedgerEra era))
, L.Era (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto
, L.EraPlutusContext 'L.PlutusV1 (ShelleyLedgerEra era)
, L.EraPParams (ShelleyLedgerEra era)
, L.EraTx (ShelleyLedgerEra era)
, L.EraTxBody (ShelleyLedgerEra era)
, L.EraTxOut (ShelleyLedgerEra era)
, L.EraUTxO (ShelleyLedgerEra era)
, L.ExtendedUTxO (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.MaryEraTxBody (ShelleyLedgerEra era)
, L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era)
Expand Down
2 changes: 0 additions & 2 deletions cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ type BabbageEraOnwardsConstraints era =
, L.Crypto (L.EraCrypto (ShelleyLedgerEra era))
, L.Era (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto
, L.EraPlutusContext 'L.PlutusV1 (ShelleyLedgerEra era)
, L.EraPParams (ShelleyLedgerEra era)
, L.EraTx (ShelleyLedgerEra era)
, L.EraTxBody (ShelleyLedgerEra era)
, L.EraTxOut (ShelleyLedgerEra era)
, L.EraUTxO (ShelleyLedgerEra era)
, L.ExtendedUTxO (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.MaryEraTxBody (ShelleyLedgerEra era)
, L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era)
Expand Down
2 changes: 0 additions & 2 deletions cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,11 @@ type ConwayEraOnwardsConstraints era =
, L.Era (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto
, L.EraGov (ShelleyLedgerEra era)
, L.EraPlutusContext 'L.PlutusV1 (ShelleyLedgerEra era)
, L.EraPParams (ShelleyLedgerEra era)
, L.EraTx (ShelleyLedgerEra era)
, L.EraTxBody (ShelleyLedgerEra era)
, L.EraTxOut (ShelleyLedgerEra era)
, L.EraUTxO (ShelleyLedgerEra era)
, L.ExtendedUTxO (ShelleyLedgerEra era)
, L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto
, L.MaryEraTxBody (ShelleyLedgerEra era)
, L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era)
Expand Down
55 changes: 28 additions & 27 deletions cardano-api/internal/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import qualified Cardano.Ledger.Alonzo.Tx as Alonzo
import qualified Cardano.Ledger.Alonzo.TxWits as Alonzo
import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.Coin as Ledger
import qualified Cardano.Ledger.Core as Ledger
import Cardano.Ledger.Credential as Ledger (Credential)
import qualified Cardano.Ledger.Crypto as Ledger
import qualified Cardano.Ledger.Keys as Ledger
Expand Down Expand Up @@ -415,7 +416,7 @@ data TransactionValidityError =
-- of their validity interval more than 36 hours into the future.
TransactionValidityIntervalError Consensus.PastHorizonException

| TransactionValidityTranslationError (Alonzo.TranslationError Ledger.StandardCrypto)
-- | TransactionValidityTranslationError (Ledger.TranslationError Ledger.StandardCrypto (Ledger.Tx Ledger.StandardCrypto))

| TransactionValidityCostModelError (Map AnyPlutusScriptVersion CostModel) String

Expand Down Expand Up @@ -443,8 +444,8 @@ instance Error TransactionValidityError where

| otherwise
= 0 -- This should be impossible.
TransactionValidityTranslationError errmsg ->
"Error translating the transaction context: " <> pshow errmsg
-- TransactionValidityTranslationError errmsg ->
-- "Error translating the transaction context: " <> pshow errmsg

TransactionValidityCostModelError cModels err ->
mconcat
Expand Down Expand Up @@ -483,10 +484,10 @@ evaluateTransactionExecutionUnitsShelley :: forall era. ()
evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo (LedgerProtocolParameters pp) utxo tx =
caseShelleyToMaryOrAlonzoEraOnwards
(const (Right Map.empty))
(\_ ->
case L.evalTxExUnits pp tx (toLedgerUTxO sbe utxo) ledgerEpochInfo systemstart of
Left err -> Left (TransactionValidityTranslationError err)
Right exmap -> Right (fromLedgerScriptExUnitsMap exmap)
(\_ -> error ""
-- case L.evalTxExUnits pp tx (toLedgerUTxO sbe utxo) ledgerEpochInfo systemstart of
-- Left err -> error " --" -- Left (TransactionValidityTranslationError err)
-- Right exmap -> Right (fromLedgerScriptExUnitsMap exmap)
)
sbe
where
Expand All @@ -511,36 +512,36 @@ evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo (LedgerProtoc
L.InvalidTxIn txin -> ScriptErrorTxInWithoutDatum txin'
where txin' = fromShelleyTxIn txin
L.MissingDatum dh -> ScriptErrorWrongDatum (ScriptDataHash dh)
L.ValidationFailure (L.ValidationFailedV1 err logs _) ->
ScriptErrorEvaluationFailed err logs
L.ValidationFailure (L.ValidationFailedV2 err logs _) ->
ScriptErrorEvaluationFailed err logs
L.ValidationFailure (L.ValidationFailedV3 err logs _) ->
ScriptErrorEvaluationFailed err logs
--L.ValidationFailure _ ->
-- ScriptErrorEvaluationFailed err logs
-- L.ValidationFailure _ ->
-- ScriptErrorEvaluationFailed err logs
--L.ValidationFailure _ ->
-- ScriptErrorEvaluationFailed err logs
L.IncompatibleBudget _ -> ScriptErrorExecutionUnitsOverflow

-- This is only possible for spending scripts and occurs when
-- we attempt to spend a key witnessed tx input with a Plutus
-- script witness.
L.RedeemerNotNeeded rdmrPtr scriptHash ->
ScriptErrorNotPlutusWitnessedTxIn
(fromAlonzoRdmrPtr rdmrPtr)
(fromShelleyScriptHash scriptHash)
-- L.RedeemerNotNeeded rdmrPtr scriptHash ->
-- ScriptErrorNotPlutusWitnessedTxIn
-- (fromAlonzoRdmrPtr rdmrPtr)
-- (fromShelleyScriptHash scriptHash)
L.RedeemerPointsToUnknownScriptHash rdmrPtr ->
ScriptErrorRedeemerPointsToUnknownScriptHash $ fromAlonzoRdmrPtr rdmrPtr
-- This should not occur while using cardano-cli because we zip together
-- the Plutus script and the use site (txin, certificate etc). Therefore
-- the redeemer pointer will always point to a Plutus script.
L.MissingScript rdmrPtr resolveable ->
let cnv1 Plutus.Plutus
{ Plutus.plutusLanguage = lang
, Plutus.plutusScript = Alonzo.BinaryPlutus bytes
} = (bytes, lang)
cnv2 (purpose, mbScript, scriptHash) = (purpose, fmap cnv1 mbScript, scriptHash)
in
ScriptErrorMissingScript rdmrPtr
$ ResolvablePointers sbe
$ Map.map cnv2 resolveable
--L.MissingScript rdmrPtr resolveable ->
-- let cnv1 Plutus.Plutus
-- { Plutus.plutusLanguage = lang
-- , Plutus.plutusScript = Alonzo.BinaryPlutus bytes
-- } = (bytes, lang)
-- cnv2 (purpose, mbScript, scriptHash) = (purpose, fmap cnv1 mbScript, scriptHash)
-- in
-- ScriptErrorMissingScript rdmrPtr
-- $ ResolvablePointers sbe
-- $ Map.map cnv2 resolveable

L.NoCostModelInLedgerState l -> ScriptErrorMissingCostModel l

Expand Down
5 changes: 2 additions & 3 deletions cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Cardano.Api.Block (EpochNo)
import Cardano.Api.Keys.Shelley (Hash (..), StakePoolKey)
import Cardano.Api.Value (Lovelace, fromShelleyLovelace)

import Cardano.Ledger.Alonzo.Plutus.TxInfo (PlutusDebug)
import qualified Cardano.Ledger.Coin as Ledger
import qualified Cardano.Ledger.Conway.Governance as Ledger
import qualified Cardano.Ledger.Core as Ledger.Core
Expand Down Expand Up @@ -58,9 +57,9 @@ data LedgerEvent
| -- | Pools have been reaped and deposits refunded.
PoolReap PoolReapDetails
-- | A number of succeeded Plutus script evaluations.
| SuccessfulPlutusScript (NonEmpty PlutusDebug)
| SuccessfulPlutusScript -- (NonEmpty PlutusDebug)
-- | A number of failed Plutus script evaluations.
| FailedPlutusScript (NonEmpty PlutusDebug)
| FailedPlutusScript --(NonEmpty PlutusDebug)


-- Only events available on the Conway Era.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ handleAlonzoOnwardsUTxOWEvent (WrappedShelleyEraEvent (Shelley.UtxoEvent (UtxosE
case utxoEvent of
Alonzo.AlonzoPpupToUtxosEvent{} -> Nothing
Alonzo.TotalDeposits{} -> Nothing
Alonzo.SuccessfulPlutusScriptsEvent e -> Just $ SuccessfulPlutusScript e
Alonzo.FailedPlutusScriptsEvent e -> Just $ FailedPlutusScript e
Alonzo.SuccessfulPlutusScriptsEvent e -> error "" -- Just $ SuccessfulPlutusScript e
Alonzo.FailedPlutusScriptsEvent e -> error "" -- Just $ FailedPlutusScript e

handlePreAlonzoUTxOWEvent
:: Event (Ledger.Core.EraRule "UTXO" ledgerera) ~ Shelley.UtxoEvent ledgerera
Expand Down
14 changes: 7 additions & 7 deletions cardano-api/internal/Cardano/Api/ProtocolParameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ data IntroducedInConwayPParams era
, icDRepVotingThresholds :: StrictMaybe Ledger.DRepVotingThresholds
, icMinCommitteeSize :: StrictMaybe Natural
, icCommitteeTermLength :: StrictMaybe EpochNo
, icGovActionLifetime :: StrictMaybe EpochNo
, icGovActionLifetime :: StrictMaybe Ledger.EpochInterval
, icGovActionDeposit :: StrictMaybe Ledger.Coin
, icDRepDeposit :: StrictMaybe Ledger.Coin
, icDRepActivity :: StrictMaybe EpochNo
, icDRepActivity :: StrictMaybe Ledger.EpochInterval
} deriving Show


Expand Down Expand Up @@ -327,7 +327,7 @@ data CommonProtocolParametersUpdate
, cppMaxBlockHeaderSize :: StrictMaybe Natural
, cppKeyDeposit :: StrictMaybe Ledger.Coin
, cppPoolDeposit :: StrictMaybe Ledger.Coin
, cppPoolRetireMaxEpoch :: StrictMaybe EpochNo
, cppPoolRetireMaxEpoch :: StrictMaybe Ledger.EpochInterval
, cppStakePoolTargetNum :: StrictMaybe Natural
, cppPoolPledgeInfluence :: StrictMaybe Ledger.NonNegativeInterval
, cppTreasuryExpansion :: StrictMaybe Ledger.UnitInterval
Expand Down Expand Up @@ -1234,7 +1234,7 @@ toShelleyCommonPParamsUpdate
(toShelleyLovelace <$> noInlineMaybeToStrictMaybe protocolUpdateStakeAddressDeposit)
& ppuPoolDepositL .~
(toShelleyLovelace <$> noInlineMaybeToStrictMaybe protocolUpdateStakePoolDeposit)
& ppuEMaxL .~ noInlineMaybeToStrictMaybe protocolUpdatePoolRetireMaxEpoch
& ppuEMaxL .~ noInlineMaybeToStrictMaybe undefined -- protocolUpdatePoolRetireMaxEpoch
& ppuNOptL .~ noInlineMaybeToStrictMaybe protocolUpdateStakePoolTargetNum
& ppuA0L .~ noInlineMaybeToStrictMaybe a0

Expand Down Expand Up @@ -1427,7 +1427,7 @@ fromShelleyCommonPParamsUpdate ppu =
strictMaybeToMaybe (ppu ^. ppuPoolDepositL)
, protocolUpdateMinPoolCost = fromShelleyLovelace <$>
strictMaybeToMaybe (ppu ^. ppuMinPoolCostL)
, protocolUpdatePoolRetireMaxEpoch = strictMaybeToMaybe (ppu ^. ppuEMaxL)
, protocolUpdatePoolRetireMaxEpoch = strictMaybeToMaybe undefined -- (ppu ^. ppuEMaxL)
, protocolUpdateStakePoolTargetNum = strictMaybeToMaybe (ppu ^. ppuNOptL)
, protocolUpdatePoolPledgeInfluence = Ledger.unboundRational <$>
strictMaybeToMaybe (ppu ^. ppuA0L)
Expand Down Expand Up @@ -1569,7 +1569,7 @@ toShelleyCommonPParams
& ppMaxBHSizeL .~ protocolParamMaxBlockHeaderSize
& ppKeyDepositL .~ toShelleyLovelace protocolParamStakeAddressDeposit
& ppPoolDepositL .~ toShelleyLovelace protocolParamStakePoolDeposit
& ppEMaxL .~ protocolParamPoolRetireMaxEpoch
& ppEMaxL .~ undefined -- protocolParamPoolRetireMaxEpoch
& ppNOptL .~ protocolParamStakePoolTargetNum
& ppA0L .~ a0
& ppRhoL .~ rho
Expand Down Expand Up @@ -1720,7 +1720,7 @@ fromShelleyCommonPParams pp =
, protocolParamStakeAddressDeposit = fromShelleyLovelace (pp ^. ppKeyDepositL)
, protocolParamStakePoolDeposit = fromShelleyLovelace (pp ^. ppPoolDepositL)
, protocolParamMinPoolCost = fromShelleyLovelace (pp ^. ppMinPoolCostL)
, protocolParamPoolRetireMaxEpoch = pp ^. ppEMaxL
, protocolParamPoolRetireMaxEpoch = undefined -- pp ^. ppEMaxL
, protocolParamStakePoolTargetNum = pp ^. ppNOptL
, protocolParamPoolPledgeInfluence = Ledger.unboundRational (pp ^. ppA0L)
, protocolParamMonetaryExpansion = Ledger.unboundRational (pp ^. ppRhoL)
Expand Down
Loading

0 comments on commit 7f246bb

Please sign in to comment.