From 72cbddffcf0150e503f3e4f10438e86c8590b40e Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Tue, 28 Nov 2023 08:47:51 -0400 Subject: [PATCH] Minor clean up --- cardano-api/gen/Test/Gen/Cardano/Api/Byron.hs | 3 +-- cardano-api/internal/Cardano/Api/Eras.hs | 2 +- cardano-api/internal/Cardano/Api/Eras/Case.hs | 8 +++++--- cardano-api/internal/Cardano/Api/InMode.hs | 6 ++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cardano-api/gen/Test/Gen/Cardano/Api/Byron.hs b/cardano-api/gen/Test/Gen/Cardano/Api/Byron.hs index 8a41c3c9f0..6a4e600bab 100644 --- a/cardano-api/gen/Test/Gen/Cardano/Api/Byron.hs +++ b/cardano-api/gen/Test/Gen/Cardano/Api/Byron.hs @@ -8,7 +8,6 @@ module Test.Gen.Cardano.Api.Byron import Cardano.Api hiding (txIns) import Cardano.Api.Byron -import qualified Cardano.Api.Byron as Byron import Data.Proxy @@ -22,7 +21,7 @@ import Test.Tasty.Hedgehog prop_byron_roundtrip_txbody_CBOR :: Property prop_byron_roundtrip_txbody_CBOR = property $ do x <- forAll $ makeSignedByronTransaction [] <$> genTxBodyByron - tripping x Byron.serializeByronTx deserialiseByronTxCddl + tripping x serializeByronTx deserialiseByronTxCddl prop_byron_roundtrip_witness_CBOR :: Property prop_byron_roundtrip_witness_CBOR = property $ do diff --git a/cardano-api/internal/Cardano/Api/Eras.hs b/cardano-api/internal/Cardano/Api/Eras.hs index 0fab2d8115..b9b8bfabef 100644 --- a/cardano-api/internal/Cardano/Api/Eras.hs +++ b/cardano-api/internal/Cardano/Api/Eras.hs @@ -38,7 +38,7 @@ module Cardano.Api.Eras -- * Era case handling - -- ** Case on CardanoEra + -- ** Case on CardanoEra , caseByronOrShelleyBasedEra -- ** Case on ShelleyBasedEra diff --git a/cardano-api/internal/Cardano/Api/Eras/Case.hs b/cardano-api/internal/Cardano/Api/Eras/Case.hs index 501703002a..d9746af1a3 100644 --- a/cardano-api/internal/Cardano/Api/Eras/Case.hs +++ b/cardano-api/internal/Cardano/Api/Eras/Case.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE EmptyCase #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} @@ -37,14 +36,17 @@ import Cardano.Api.Eon.ShelleyToBabbageEra import Cardano.Api.Eon.ShelleyToMaryEra import Cardano.Api.Eras.Core --- | @caseByronOrShelleyBasedEra f g era@ applies @f@ to byron and @g@ to other eras. +-- | @caseByronOrShelleyBasedEra f g era@ returns @f@ in Byron and applies @g@ to Shelley-based eras. caseByronOrShelleyBasedEra :: () => a -> (ShelleyBasedEraConstraints era => ShelleyBasedEra era -> a) -> CardanoEra era -> a caseByronOrShelleyBasedEra l r = \case - ByronEra -> l + ByronEra -> l -- We no longer provide the witness because Byron is isolated. + -- This function will be deleted shortly after build-raw --byron-era is + -- deprecated in cardano-cli + ShelleyEra -> r ShelleyBasedEraShelley AllegraEra -> r ShelleyBasedEraAllegra MaryEra -> r ShelleyBasedEraMary diff --git a/cardano-api/internal/Cardano/Api/InMode.hs b/cardano-api/internal/Cardano/Api/InMode.hs index a1f690aa99..40630a41e0 100644 --- a/cardano-api/internal/Cardano/Api/InMode.hs +++ b/cardano-api/internal/Cardano/Api/InMode.hs @@ -61,14 +61,14 @@ import GHC.Generics -- LocalTxSubmission protocol. -- data TxInMode where - -- | Shelley based transations. + -- | Shelley based transactions. -- TxInMode :: ShelleyBasedEra era -> Tx era -> TxInMode - -- | Legacy Byron transactions. Byron has various things we can + -- | Legacy Byron transactions and things we can -- post to the chain which are not actually transactions. -- This covers: update proposals, votes and delegation certs. -- @@ -105,8 +105,6 @@ fromConsensusGenTx = \case in TxInMode ShelleyBasedEraConway (ShelleyTx ShelleyBasedEraConway shelleyEraTx) --- mkByronTx = Consensus.ByronTx (Consensus.byronIdTx tx) tx - toConsensusGenTx :: () => Consensus.CardanoBlock L.StandardCrypto ~ block => TxInMode