Skip to content

Commit

Permalink
Integration work for node 8.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Nov 14, 2023
1 parent 65240dd commit 537e1a2
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 139 deletions.
59 changes: 57 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ 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-08-06T23:58:58Z
, cardano-haskell-packages 2023-10-26T16:30:55Z
, hackage.haskell.org 2023-11-10T00:00:00Z
, cardano-haskell-packages 2023-11-10T00:00:00Z

packages:
cardano-api
Expand All @@ -38,6 +38,61 @@ test-show-details: direct
-- Always write GHC env files, because they are needed for ghci.
write-ghc-environment-files: always

constraints:
-- Plutus is incompatible with 0.1.5 because of the NoThunks (Identity a)
-- instance, once they fix that we shall remove this constraint.
nothunks == 0.1.4

-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

-- branch: jasagredo/node-8.7.0
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: f85ec6f2e0a80101009187f79ff154ab33a82a21
--sha256: 192jn0q73020qmvv0hzk11ai7sm7p2yd66qkhdyp5niffrwybzkr
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/alonzo/test-suite
eras/babbage/impl
eras/babbage/test-suite
eras/conway/impl
eras/conway/test-suite
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-ledger-pretty
libs/cardano-protocol-tpraos
libs/non-integral
libs/small-steps
libs/small-steps-test
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/ledger/impl/test
eras/byron/crypto
eras/byron/crypto/test

-- branch: jasagredo/node-8.7.0
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-consensus
tag: 9d6a9de9a46a68a9d748969002131328d6600a40
--sha256: 1s19vfwkvq8346k2yj59dahmkc5nxq0nwzrhi8rbli8qyi25qayi
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-protocol
ouroboros-consensus-diffusion
sop-extras
strict-sop-core
2 changes: 1 addition & 1 deletion cardano-api/gen/Test/Gen/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module Test.Gen.Cardano.Api

import qualified Cardano.Ledger.Alonzo.Core as Ledger
import qualified Cardano.Ledger.Alonzo.Genesis as Alonzo
import qualified Cardano.Ledger.Alonzo.Language as Alonzo
import qualified Cardano.Ledger.Alonzo.Scripts as Alonzo
import qualified Cardano.Ledger.BaseTypes as Ledger
import qualified Cardano.Ledger.Coin as Ledger
import qualified Cardano.Ledger.Plutus.Language as Alonzo
import Cardano.Ledger.Shelley.TxAuxData (Metadatum (..), ShelleyTxAuxData (..))

import qualified Data.Map.Strict as Map
Expand Down
8 changes: 4 additions & 4 deletions cardano-api/internal/Cardano/Api/Address.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ import Cardano.Api.Utils

import qualified Cardano.Chain.Common as Byron
import qualified Cardano.Ledger.Address as Shelley
import qualified Cardano.Ledger.Alonzo.TxInfo as Alonzo
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 PlutusLedgerApi.V1 as Plutus
import qualified PlutusLedgerApi.V1 as PlutusAPI

import Control.Applicative ((<|>))
import Control.DeepSeq (NFData (..), deepseq)
Expand Down Expand Up @@ -620,11 +620,11 @@ isKeyAddress (AddressInEra (ShelleyAddressInEra _) (ShelleyAddress _ pCred _)) =
PaymentCredentialByScript _ -> False

-- | Converts a Shelley payment address to a Plutus public key hash.
shelleyPayAddrToPlutusPubKHash :: Address ShelleyAddr -> Maybe Plutus.PubKeyHash
shelleyPayAddrToPlutusPubKHash :: Address ShelleyAddr -> Maybe PlutusAPI.PubKeyHash
shelleyPayAddrToPlutusPubKHash (ShelleyAddress _ payCred _) =
case payCred of
Shelley.ScriptHashObj _ -> Nothing
Shelley.KeyHashObj kHash -> Just $ Alonzo.transKeyHash kHash
Shelley.KeyHashObj kHash -> Just $ Plutus.transKeyHash kHash

-- ----------------------------------------------------------------------------
-- Internal conversion functions
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ import Cardano.Binary
import qualified Cardano.Crypto.Hash.Blake2b as Blake2b
import qualified Cardano.Crypto.Hash.Class as C
import qualified Cardano.Crypto.VRF as C
import qualified Cardano.Ledger.Alonzo.Language as L
import qualified Cardano.Ledger.Alonzo.Plutus.TxInfo as L
import qualified Cardano.Ledger.Alonzo.Scripts as L
import qualified Cardano.Ledger.Alonzo.Tx as L
import qualified Cardano.Ledger.Alonzo.TxInfo as L
import qualified Cardano.Ledger.Alonzo.TxWits as L
import qualified Cardano.Ledger.Alonzo.UTxO as L
import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.BaseTypes as L
import qualified Cardano.Ledger.Core as L
import qualified Cardano.Ledger.Mary.Value as L
import qualified Cardano.Ledger.Plutus.Language as L
import qualified Cardano.Ledger.SafeHash as L
import qualified Cardano.Ledger.UTxO as L
import qualified Ouroboros.Consensus.Protocol.Abstract as Consensus
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ import Cardano.Binary
import qualified Cardano.Crypto.Hash.Blake2b as Blake2b
import qualified Cardano.Crypto.Hash.Class as C
import qualified Cardano.Crypto.VRF as C
import qualified Cardano.Ledger.Alonzo.Language as L
import qualified Cardano.Ledger.Alonzo.Plutus.TxInfo as L
import qualified Cardano.Ledger.Alonzo.Scripts as L
import qualified Cardano.Ledger.Alonzo.TxInfo as L
import qualified Cardano.Ledger.Alonzo.UTxO as L
import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.Babbage.TxOut as L
import qualified Cardano.Ledger.BaseTypes as L
import qualified Cardano.Ledger.Core as L
import qualified Cardano.Ledger.Mary.Value as L
import qualified Cardano.Ledger.Plutus.Language as L
import qualified Cardano.Ledger.SafeHash as L
import qualified Cardano.Ledger.UTxO as L
import qualified Ouroboros.Consensus.Protocol.Abstract as Consensus
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ import Cardano.Binary
import qualified Cardano.Crypto.Hash.Blake2b as Blake2b
import qualified Cardano.Crypto.Hash.Class as C
import qualified Cardano.Crypto.VRF as C
import qualified Cardano.Ledger.Alonzo.Language as L
import qualified Cardano.Ledger.Alonzo.Plutus.TxInfo as L
import qualified Cardano.Ledger.Alonzo.Scripts as L
import qualified Cardano.Ledger.Alonzo.TxInfo as L
import qualified Cardano.Ledger.Alonzo.UTxO as L
import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.BaseTypes as L
Expand All @@ -37,6 +36,7 @@ import qualified Cardano.Ledger.Conway.Governance as L
import qualified Cardano.Ledger.Conway.PParams as L
import qualified Cardano.Ledger.Conway.TxCert as L
import qualified Cardano.Ledger.Mary.Value as L
import qualified Cardano.Ledger.Plutus.Language as L
import qualified Cardano.Ledger.SafeHash as L
import qualified Cardano.Ledger.UTxO as L
import qualified Ouroboros.Consensus.Protocol.Abstract as Consensus
Expand Down
14 changes: 7 additions & 7 deletions cardano-api/internal/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ import Cardano.Api.Value
import qualified Cardano.Binary as CBOR
import qualified Cardano.Chain.Common as Byron
import qualified Cardano.Ledger.Alonzo.Core as Ledger
import qualified Cardano.Ledger.Alonzo.Language as Alonzo
import qualified Cardano.Ledger.Alonzo.Plutus.TxInfo as Alonzo
import qualified Cardano.Ledger.Alonzo.Scripts as Alonzo
import qualified Cardano.Ledger.Alonzo.Tx as Alonzo
import qualified Cardano.Ledger.Alonzo.TxInfo 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 Cardano.Ledger.Credential as Ledger (Credential)
import qualified Cardano.Ledger.Crypto as Ledger
import qualified Cardano.Ledger.Keys as Ledger
import qualified Cardano.Ledger.Plutus.Language as Plutus
import qualified Cardano.Ledger.Shelley.API.Wallet as Ledger (evaluateTransactionFee)
import qualified Ouroboros.Consensus.HardFork.History as Consensus
import qualified PlutusLedgerApi.V1 as Plutus
Expand Down Expand Up @@ -290,7 +290,7 @@ data ResolvablePointers where
-> Map
Alonzo.RdmrPtr
( Alonzo.ScriptPurpose (ShelleyLedgerEra era)
, Maybe (PlutusScriptBytes, Alonzo.Language)
, Maybe (PlutusScriptBytes, Plutus.Language)
, Ledger.ScriptHash Ledger.StandardCrypto
)
-> ResolvablePointers
Expand Down Expand Up @@ -349,7 +349,7 @@ data ScriptExecutionError =
ResolvablePointers -- A mapping a pointers that are possible to resolve

-- | A cost model was missing for a language which was used.
| ScriptErrorMissingCostModel Alonzo.Language
| ScriptErrorMissingCostModel Plutus.Language
deriving Show

instance Error ScriptExecutionError where
Expand Down Expand Up @@ -535,9 +535,9 @@ evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo (LedgerProtoc
-- 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 Alonzo.Plutus
{ Alonzo.plutusLanguage = lang
, Alonzo.plutusScript = Alonzo.BinaryPlutus bytes
let cnv1 Plutus.Plutus
{ Plutus.plutusLanguage = lang
, Plutus.plutusScript = Alonzo.BinaryPlutus bytes
} = (bytes, lang)
cnv2 (purpose, mbScript, scriptHash) = (purpose, fmap cnv1 mbScript, scriptHash)
in
Expand Down
6 changes: 3 additions & 3 deletions cardano-api/internal/Cardano/Api/Ledger/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ mkAdaValue :: ShelleyBasedEra era -> L.Coin -> L.Value (ShelleyLedgerEra era)
mkAdaValue sbe coin =
caseShelleyToAllegraOrMaryEraOnwards
(const coin)
(const (L.MaryValue (L.unCoin coin) mempty))
(const (L.MaryValue coin mempty))
sbe

adaAssetL :: ShelleyBasedEra era -> Lens' (L.Value (ShelleyLedgerEra era)) L.Coin
Expand All @@ -206,8 +206,8 @@ adaAssetShelleyToAllegraEraL w =
adaAssetMaryEraOnwardsL :: MaryEraOnwards era -> Lens' (L.MaryValue L.StandardCrypto) L.Coin
adaAssetMaryEraOnwardsL w =
maryEraOnwardsConstraints w $ lens
(\(L.MaryValue c _) -> L.Coin c)
(\(L.MaryValue _ ma) (L.Coin c) -> L.MaryValue c ma)
(\(L.MaryValue c _) -> c)
(\(L.MaryValue _ ma) c -> L.MaryValue c ma)

multiAssetL :: MaryEraOnwards era -> Lens' (L.MaryValue L.StandardCrypto) (L.MultiAsset L.StandardCrypto)
multiAssetL w =
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/LedgerEvent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import Cardano.Api.Block (EpochNo)
import Cardano.Api.Keys.Shelley (Hash (StakePoolKeyHash), StakePoolKey)
import Cardano.Api.Value (Lovelace, fromShelleyDeltaLovelace, fromShelleyLovelace)

import Cardano.Ledger.Alonzo.Plutus.TxInfo (PlutusDebug)
import Cardano.Ledger.Alonzo.Rules (AlonzoBbodyEvent (..), AlonzoUtxoEvent (..),
AlonzoUtxosEvent (FailedPlutusScriptsEvent, SuccessfulPlutusScriptsEvent),
AlonzoUtxowEvent (..))
import Cardano.Ledger.Alonzo.TxInfo (PlutusDebug)
import Cardano.Ledger.Api.Era (AllegraEra, AlonzoEra, BabbageEra, ConwayEra, MaryEra,
ShelleyEra)
import qualified Cardano.Ledger.Coin as Ledger
Expand Down
64 changes: 33 additions & 31 deletions cardano-api/internal/Cardano/Api/Orphans.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ instance Crypto.Crypto crypto => ToJSON (Consensus.StakeSnapshots crypto) where
toJSON = object . stakeSnapshotsToPair
toEncoding = pairs . mconcat . stakeSnapshotsToPair

stakeSnapshotsToPair :: (Aeson.KeyValue a, Crypto.Crypto crypto) => Consensus.StakeSnapshots crypto -> [a]
stakeSnapshotsToPair :: (Aeson.KeyValue e a, Crypto.Crypto crypto) => Consensus.StakeSnapshots crypto -> [a]
stakeSnapshotsToPair Consensus.StakeSnapshots
{ Consensus.ssStakeSnapshots
, Consensus.ssMarkTotal
Expand All @@ -82,7 +82,7 @@ instance ToJSON (Consensus.StakeSnapshot crypto) where
toJSON = object . stakeSnapshotToPair
toEncoding = pairs . mconcat . stakeSnapshotToPair

stakeSnapshotToPair :: Aeson.KeyValue a => Consensus.StakeSnapshot crypto -> [a]
stakeSnapshotToPair :: Aeson.KeyValue e a => Consensus.StakeSnapshot crypto -> [a]
stakeSnapshotToPair Consensus.StakeSnapshot
{ Consensus.ssMarkPool
, Consensus.ssSetPool
Expand Down Expand Up @@ -302,35 +302,37 @@ instance Semigroup (Ledger.BabbagePParams StrictMaybe era) where

instance Semigroup (Ledger.ConwayPParams StrictMaybe era) where
(<>) p1 p2 = Ledger.ConwayPParams
{ Ledger.cppMinFeeA = lastMappendWith Ledger.cppMinFeeA p1 p2
, Ledger.cppMinFeeB = lastMappendWith Ledger.cppMinFeeB p1 p2
, Ledger.cppMaxBBSize = lastMappendWith Ledger.cppMaxBBSize p1 p2
, Ledger.cppMaxTxSize = lastMappendWith Ledger.cppMaxTxSize p1 p2
, Ledger.cppMaxBHSize = lastMappendWith Ledger.cppMaxBHSize p1 p2
, Ledger.cppKeyDeposit = lastMappendWith Ledger.cppKeyDeposit p1 p2
, Ledger.cppPoolDeposit = lastMappendWith Ledger.cppPoolDeposit p1 p2
, Ledger.cppEMax = lastMappendWith Ledger.cppEMax p1 p2
, Ledger.cppNOpt = lastMappendWith Ledger.cppNOpt p1 p2
, Ledger.cppA0 = lastMappendWith Ledger.cppA0 p1 p2
, Ledger.cppRho = lastMappendWith Ledger.cppRho p1 p2
, Ledger.cppTau = lastMappendWith Ledger.cppTau p1 p2
{ Ledger.cppMinFeeA = lastMappendWithTHKD Ledger.cppMinFeeA p1 p2
, Ledger.cppMinFeeB = lastMappendWithTHKD Ledger.cppMinFeeB p1 p2
, Ledger.cppMaxBBSize = lastMappendWithTHKD Ledger.cppMaxBBSize p1 p2
, Ledger.cppMaxTxSize = lastMappendWithTHKD Ledger.cppMaxTxSize p1 p2
, Ledger.cppMaxBHSize = lastMappendWithTHKD Ledger.cppMaxBHSize p1 p2
, Ledger.cppKeyDeposit = lastMappendWithTHKD Ledger.cppKeyDeposit p1 p2
, Ledger.cppPoolDeposit = lastMappendWithTHKD Ledger.cppPoolDeposit p1 p2
, Ledger.cppEMax = lastMappendWithTHKD Ledger.cppEMax p1 p2
, Ledger.cppNOpt = lastMappendWithTHKD Ledger.cppNOpt p1 p2
, Ledger.cppA0 = lastMappendWithTHKD Ledger.cppA0 p1 p2
, Ledger.cppRho = lastMappendWithTHKD Ledger.cppRho p1 p2
, Ledger.cppTau = lastMappendWithTHKD Ledger.cppTau p1 p2
, Ledger.cppProtocolVersion = NoUpdate -- For conway, protocol version cannot be changed via `PParamsUpdate`
, Ledger.cppMinPoolCost = lastMappendWith Ledger.cppMinPoolCost p1 p2
, Ledger.cppCoinsPerUTxOByte = lastMappendWith Ledger.cppCoinsPerUTxOByte p1 p2
, Ledger.cppCostModels = lastMappendWith Ledger.cppCostModels p1 p2
, Ledger.cppPrices = lastMappendWith Ledger.cppPrices p1 p2
, Ledger.cppMaxTxExUnits = lastMappendWith Ledger.cppMaxTxExUnits p1 p2
, Ledger.cppMaxBlockExUnits = lastMappendWith Ledger.cppMaxBlockExUnits p1 p2
, Ledger.cppMaxValSize = lastMappendWith Ledger.cppMaxValSize p1 p2
, Ledger.cppCollateralPercentage = lastMappendWith Ledger.cppCollateralPercentage p1 p2
, Ledger.cppMaxCollateralInputs = lastMappendWith Ledger.cppMaxCollateralInputs p1 p2
, Ledger.cppPoolVotingThresholds = lastMappendWith Ledger.cppPoolVotingThresholds p1 p2
, Ledger.cppDRepVotingThresholds = lastMappendWith Ledger.cppDRepVotingThresholds p1 p2
, Ledger.cppCommitteeMinSize = lastMappendWith Ledger.cppCommitteeMinSize p1 p2
, Ledger.cppCommitteeMaxTermLength = lastMappendWith Ledger.cppCommitteeMaxTermLength p1 p2
, Ledger.cppGovActionLifetime = lastMappendWith Ledger.cppGovActionLifetime p1 p2
, Ledger.cppGovActionDeposit = lastMappendWith Ledger.cppGovActionDeposit p1 p2
, Ledger.cppDRepDeposit = lastMappendWith Ledger.cppDRepDeposit p1 p2
, Ledger.cppDRepActivity = lastMappendWith Ledger.cppDRepActivity p1 p2
, Ledger.cppMinPoolCost = lastMappendWithTHKD Ledger.cppMinPoolCost p1 p2
, Ledger.cppCoinsPerUTxOByte = lastMappendWithTHKD Ledger.cppCoinsPerUTxOByte p1 p2
, Ledger.cppCostModels = lastMappendWithTHKD Ledger.cppCostModels p1 p2
, Ledger.cppPrices = lastMappendWithTHKD Ledger.cppPrices p1 p2
, Ledger.cppMaxTxExUnits = lastMappendWithTHKD Ledger.cppMaxTxExUnits p1 p2
, Ledger.cppMaxBlockExUnits = lastMappendWithTHKD Ledger.cppMaxBlockExUnits p1 p2
, Ledger.cppMaxValSize = lastMappendWithTHKD Ledger.cppMaxValSize p1 p2
, Ledger.cppCollateralPercentage = lastMappendWithTHKD Ledger.cppCollateralPercentage p1 p2
, Ledger.cppMaxCollateralInputs = lastMappendWithTHKD Ledger.cppMaxCollateralInputs p1 p2
, Ledger.cppPoolVotingThresholds = lastMappendWithTHKD Ledger.cppPoolVotingThresholds p1 p2
, Ledger.cppDRepVotingThresholds = lastMappendWithTHKD Ledger.cppDRepVotingThresholds p1 p2
, Ledger.cppCommitteeMinSize = lastMappendWithTHKD Ledger.cppCommitteeMinSize p1 p2
, Ledger.cppCommitteeMaxTermLength = lastMappendWithTHKD Ledger.cppCommitteeMaxTermLength p1 p2
, Ledger.cppGovActionLifetime = lastMappendWithTHKD Ledger.cppGovActionLifetime p1 p2
, Ledger.cppGovActionDeposit = lastMappendWithTHKD Ledger.cppGovActionDeposit p1 p2
, Ledger.cppDRepDeposit = lastMappendWithTHKD Ledger.cppDRepDeposit p1 p2
, Ledger.cppDRepActivity = lastMappendWithTHKD Ledger.cppDRepActivity p1 p2
}

lastMappendWithTHKD :: (a -> Ledger.THKD g StrictMaybe b) -> a -> a -> Ledger.THKD g StrictMaybe b
lastMappendWithTHKD f a b = Ledger.THKD $ lastMappendWith (Ledger.unTHKD . f) a b
Loading

0 comments on commit 537e1a2

Please sign in to comment.