Skip to content

Commit

Permalink
cardano-api: 8.47 -> 8.48
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Jul 15, 2024
1 parent 4dfd547 commit 7931f82
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cardano-api-classy/cardano-api-classy.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ library
-- dependencies on cardano-ledger* follow.
build-depends:
, base >=4.16
, cardano-api ^>=8.47
, cardano-api ^>=8.48
, cardano-ledger-alonzo
, cardano-ledger-conway
, cardano-ledger-core
2 changes: 1 addition & 1 deletion hydra-cardano-api/hydra-cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ library
, base >=4.16
, base16-bytestring
, bytestring
, cardano-api ^>=8.47
, cardano-api ^>=8.48
, cardano-api-classy
, cardano-binary
, cardano-crypto-class
Expand Down
4 changes: 2 additions & 2 deletions hydra-node/hydra-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ library
, optparse-applicative
, ouroboros-consensus
, ouroboros-consensus-cardano
, ouroboros-network-api ^>=0.7.1
, ouroboros-network-api >=0.7.1
, ouroboros-network-framework
, ouroboros-network-protocols ^>=0.8
, ouroboros-network-protocols >=0.8
, plutus-core >=1.21
, plutus-ledger-api >=1.21
, prometheus
Expand Down
6 changes: 3 additions & 3 deletions hydra-plutus-extras/src/Hydra/Plutus/Extras.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import Cardano.Api.Shelley (PlutusScript (PlutusScriptSerialised))
import PlutusLedgerApi.Common (SerialisedScript)
import PlutusLedgerApi.V2 (ScriptHash (..))
import PlutusTx (BuiltinData, UnsafeFromData (..))
import PlutusTx.Prelude (check, toBuiltin)
import PlutusTx.Prelude (BuiltinUnit, check, toBuiltin)

-- * Vendored from plutus-ledger

-- | Signature of an untyped validator script.
type ValidatorType = BuiltinData -> BuiltinData -> BuiltinData -> ()
type ValidatorType = BuiltinData -> BuiltinData -> BuiltinData -> BuiltinUnit

-- | Wrap a typed validator to get the basic `ValidatorType` signature which can
-- be passed to `PlutusTx.compile`.
Expand All @@ -42,7 +42,7 @@ wrapValidator f d r c =
{-# INLINEABLE wrapValidator #-}

-- | Signature of an untyped minting policy script.
type MintingPolicyType = BuiltinData -> BuiltinData -> ()
type MintingPolicyType = BuiltinData -> BuiltinData -> BuiltinUnit

-- | Wrap a typed minting policy to get the basic `MintingPolicyType` signature
-- which can be passed to `PlutusTx.compile`.
Expand Down
30 changes: 23 additions & 7 deletions hydra-test-utils/src/Test/Plutus/Validator.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}

{-# HLINT ignore "Use <$>" #-}

-- | A helper module mostly wrapping the Alonzo.Tools'
-- 'evaluateTransactionExecutionUnits' with a much simpler API (just a plutus
-- script).
Expand Down Expand Up @@ -56,6 +60,7 @@ import Hydra.Cardano.Api (
pattern TxInsCollateral,
pattern TxOut,
)
import Hydra.Cardano.Api.Prelude (ScriptExecutionError, ScriptWitnessIndex, TransactionValidityError)
import PlutusLedgerApi.Common (SerialisedScript)
import PlutusTx qualified as Plutus
import Prelude qualified
Expand All @@ -76,14 +81,25 @@ evaluateScriptExecutionUnits validatorScript redeemer =
Left e ->
Left ("unexpected failure: " <> show e)
where
result ::
Either
(TransactionValidityError UTxO.Era)
( Map
ScriptWitnessIndex
( Either
ScriptExecutionError
ExecutionUnits
)
)
result =
evaluateTransactionExecutionUnits
cardanoEra
systemStart
(LedgerEpochInfo epochInfo)
(LedgerProtocolParameters pparams)
(UTxO.toApi utxo)
body
(fmap . fmap . fmap) snd $
evaluateTransactionExecutionUnits
cardanoEra
systemStart
(LedgerEpochInfo epochInfo)
(LedgerProtocolParameters pparams)
(UTxO.toApi utxo)
body

(body, utxo) = transactionBodyFromScript validatorScript redeemer

Expand Down

0 comments on commit 7931f82

Please sign in to comment.