From faacc9f6ae88d4bdca27a523a5f340cfe4024692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joosep=20J=C3=A4=C3=A4ger?= Date: Tue, 12 Nov 2024 14:22:00 +0200 Subject: [PATCH] Fixed translation of StakeReference --- cabal.project | 4 ++-- eras/shelley/impl/CHANGELOG.md | 2 ++ .../Ledger/Conformance/SpecTranslate/Conway/Base.hs | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cabal.project b/cabal.project index d68629a1231..fd3a95c36bd 100644 --- a/cabal.project +++ b/cabal.project @@ -24,8 +24,8 @@ source-repository-package -- !WARNING!: -- MAKE SURE THIS POINTS TO A COMMIT IN `MAlonzo-code` BEFORE MERGE! subdir: generated - tag: 4c38bca875fc6ad1faf12a94508ac1645722a663 - --sha256: sha256-0+2u8pG947XDLRFaT87DGHRlilGf94av0dg7a6MnfAM= + tag: 511c5632eff71f4811b48fba71e7aaadfd69211a + --sha256: sha256-J6Sbrr9Klz3N72wT2ZF02z5G6iFHjpwfUH2pFVoJr3c= -- NOTE: If you would like to update the above, look for the `MAlonzo-code` -- branch in the `formal-ledger-specifications` repo and copy the SHA of -- the commit you need. The `MAlonzo-code` branch functions like an alternative diff --git a/eras/shelley/impl/CHANGELOG.md b/eras/shelley/impl/CHANGELOG.md index 75e4089a921..54dc411d640 100644 --- a/eras/shelley/impl/CHANGELOG.md +++ b/eras/shelley/impl/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.15.0.0 +* Added `Generic`, `Eq`, `Show`, `NFData`, `EncCBOR` instances for `ShelleyLedgersEnv` * Remove deprecated `witsVKeyNeededGov`, `witsVKeyNeededNoGov`, `shelleyWitsVKeyNeeded` and `propWits` * Remove deprecated `PPUPPredFailure`, `delPlAcnt`, `prAcnt`, `votedValue` * Remove impossible predicate failure `StakeKeyInRewardsDELEG` @@ -34,6 +35,7 @@ ### `testlib` +* Added `ToExpr` instance for `ShelleyLedgersEnv` * Changed type signature of `freshKeyHashVRF` to return `VRFVerKeyHash` instead of just a `Hash` * Added `expectUTxOContent` * Added `disableTreasuryExpansion` diff --git a/libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Base.hs b/libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Base.hs index e95781a9027..2b893b65f6d 100644 --- a/libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Base.hs +++ b/libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Base.hs @@ -151,11 +151,11 @@ instance SpecTranslate ctx (TxIn era) where toSpecRep (TxIn txId txIx) = toSpecRep (txId, txIx) instance SpecTranslate ctx (StakeReference era) where - type SpecRep (StakeReference era) = Agda.Credential + type SpecRep (StakeReference era) = Maybe Agda.Credential - toSpecRep (StakeRefBase c) = toSpecRep c - toSpecRep (StakeRefPtr _) = error "Cannot translate StakeRefPtr" - toSpecRep StakeRefNull = error "Cannot translate StakeRefNull" + toSpecRep (StakeRefBase c) = Just <$> toSpecRep c + toSpecRep (StakeRefPtr _) = pure Nothing + toSpecRep StakeRefNull = pure Nothing instance SpecTranslate ctx (BootstrapAddress era) where type SpecRep (BootstrapAddress era) = Agda.BootstrapAddr