Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to cardano-api-8.20 #1075

Merged
merged 8 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ changes.

## [0.13.0] - UNRELEASED

- **BREAKING** Update to plutus 1.9. This changes the script hashes.

- Query at the tip for local cardano-node queries. We witnessed these queries
failing in case of a rollback and always querying at the tip seems to fix
this.


- **BREAKING** Changes to `hydra-plutus` scripts.

- Add option to draft a commit tx using inline datums.
Expand Down
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repository cardano-haskell-packages

-- See CONTRIBUTING.md for information about when and how to update these.
index-state:
, hackage.haskell.org 2023-08-02T06:54:18Z
, cardano-haskell-packages 2023-08-01T16:16:59Z
, hackage.haskell.org 2023-09-14T06:54:18Z
, cardano-haskell-packages 2023-09-14T16:16:59Z

packages:
hydra-prelude
Expand Down
105 changes: 53 additions & 52 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions hydra-cardano-api/hydra-cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ common project-config
TupleSections
TypeApplications
TypeFamilies
TypeOperators
TypeSynonymInstances
ViewPatterns

Expand Down Expand Up @@ -119,19 +120,19 @@ library
, base >=4.16
, base16-bytestring
, bytestring
, cardano-api >=8.11.0 && <8.12
, cardano-api >=8.20.0 && <8.21
, cardano-binary >=1.7.0 && <1.8
, cardano-crypto-class >=2.1.1 && <2.2
, cardano-ledger-allegra >=1.2.1 && <1.3
, cardano-ledger-alonzo >=1.3.3 && <1.4
, cardano-ledger-alonzo >=1.4 && <1.5
, cardano-ledger-babbage >=1.4.2 && <1.5
, cardano-ledger-binary >=1.1.1 && <1.2
, cardano-ledger-byron >=1.0.0 && <1.1
, cardano-ledger-core >=1.4.1 && <1.5
, cardano-ledger-core >=1.6 && <1.7
, cardano-ledger-mary >=1.3.1 && <1.4
, cardano-ledger-shelley >=1.4.2 && <1.5
, cardano-ledger-shelley >=1.6 && <1.7
, containers
, plutus-ledger-api >=1.7.0 && <1.8
, plutus-ledger-api >=1.9.0 && <1.10
, QuickCheck
, serialise
, text >=2
25 changes: 7 additions & 18 deletions hydra-cardano-api/src/Hydra/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module Hydra.Cardano.Api (
Era,
LedgerEra,
ledgerEraVersion,
LedgerProtocolParameters (..),

-- * Wrapped Types
module Hydra.Cardano.Api,
Expand All @@ -40,7 +41,6 @@ import Cardano.Api as X hiding (
AddressInEra (..),
AddressTypeInEra (..),
BalancedTxBody (..),
BundledProtocolParameters (..),
Key (..),
KeyWitness,
PlutusScript,
Expand Down Expand Up @@ -108,8 +108,11 @@ import Cardano.Api.UTxO (
import Hydra.Cardano.Api.Prelude (
Era,
LedgerEra,
LedgerProtocolParameters,
Map,
Proposal,
StandardCrypto,
VotingProcedures,
ledgerEraVersion,
)

Expand Down Expand Up @@ -208,20 +211,6 @@ pattern BalancedTxBody{balancedTxBodyContent, balancedTxBody, balancedTxChangeOu
BalancedTxBody =
Cardano.Api.BalancedTxBody

-- ** BundledProtocolParameters

type BundledProtocolParameters = Cardano.Api.BundledProtocolParameters Era

pattern BundleAsShelleyBasedProtocolParameters ::
ProtocolParameters ->
Ledger.PParams LedgerEra ->
BundledProtocolParameters
pattern BundleAsShelleyBasedProtocolParameters{shelleyPParams, ledgerParams} <-
Cardano.Api.Shelley.BundleAsShelleyBasedProtocolParameters _ shelleyPParams ledgerParams
where
BundleAsShelleyBasedProtocolParameters =
Cardano.Api.BundleAsShelleyBasedProtocolParameters ShelleyBasedEraBabbage

-- ** KeyWitness

type KeyWitness = Cardano.Api.KeyWitness Era
Expand Down Expand Up @@ -396,14 +385,14 @@ pattern TxBodyContent ::
TxMetadataInEra ->
TxAuxScripts ->
TxExtraKeyWitnesses ->
BuildTxWith build (Maybe ProtocolParameters) ->
BuildTxWith build (Maybe (LedgerProtocolParameters Era)) ->
TxWithdrawals build Era ->
TxCertificates build Era ->
TxUpdateProposal Era ->
TxMintValue build ->
TxScriptValidity ->
TxGovernanceActions Era ->
TxVotes Era ->
Maybe (Featured ConwayEraOnwards Era [Proposal Era]) ->
Maybe (Featured ConwayEraOnwards Era (VotingProcedures Era)) ->
TxBodyContent build
pattern TxBodyContent
{ txIns
Expand Down
4 changes: 2 additions & 2 deletions hydra-cardano-api/src/Hydra/Cardano/Api/PlutusScript.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Test.QuickCheck (listOf)
fromLedgerScript :: HasCallStack => Ledger.AlonzoScript era -> PlutusScript lang
fromLedgerScript = \case
Ledger.TimelockScript{} -> error "fromLedgerScript: TimelockScript"
Ledger.PlutusScript _ bytes -> PlutusScriptSerialised bytes
Ledger.PlutusScript (Ledger.Plutus _ (Ledger.BinaryPlutus bytes)) -> PlutusScriptSerialised bytes

-- | Convert a cardano-api 'PlutusScript' into a cardano-ledger 'Script'.
toLedgerScript ::
Expand All @@ -34,7 +34,7 @@ toLedgerScript (PlutusScriptSerialised bytes) =
PlutusScriptV1 -> Ledger.PlutusV1
PlutusScriptV2 -> Ledger.PlutusV2
PlutusScriptV3 -> Ledger.PlutusV3
in Ledger.PlutusScript lang bytes
in Ledger.PlutusScript $ Ledger.Plutus lang (Ledger.BinaryPlutus bytes)

-- | Convert a serialized plutus script into a cardano-api 'PlutusScript'.
fromPlutusScript :: Plutus.SerialisedScript -> PlutusScript lang
Expand Down
2 changes: 1 addition & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ txOuts' (getTxBody -> txBody) =
-- Number of assets, presence of datum and/or reference scripts may affect this
-- minimum value.
mkTxOutAutoBalance ::
BundledProtocolParameters Era ->
Ledger.PParams LedgerEra ->
AddressInEra Era ->
Value ->
TxOutDatum CtxTx Era ->
Expand Down
Loading