From 626847349220e4dce7878b1e6041b9e3d5924955 Mon Sep 17 00:00:00 2001 From: Jared Corduan Date: Thu, 13 May 2021 12:33:15 -0400 Subject: [PATCH] Adding some instances needed for consensus. --- alonzo/impl/src/Cardano/Ledger/Alonzo/Translation.hs | 6 +++++- .../executable-spec/src/Cardano/Ledger/Shelley.hs | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/alonzo/impl/src/Cardano/Ledger/Alonzo/Translation.hs b/alonzo/impl/src/Cardano/Ledger/Alonzo/Translation.hs index a6b0a93516b..cb52c457959 100644 --- a/alonzo/impl/src/Cardano/Ledger/Alonzo/Translation.hs +++ b/alonzo/impl/src/Cardano/Ledger/Alonzo/Translation.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} @@ -37,6 +39,8 @@ import qualified Cardano.Ledger.Tx as LTX import Control.Monad.Except (Except, throwError) import Data.Map.Strict (Map) import Data.Text (Text) +import GHC.Generics (Generic) +import NoThunks.Class (NoThunks) import Numeric.Natural (Natural) import Shelley.Spec.Ledger.API ( EpochState (..), @@ -73,7 +77,7 @@ data AlonzoGenesis = AlonzoGenesis collateralPercentage :: Natural, maxCollateralInputs :: Natural } - deriving (Eq) + deriving (Eq, Generic, NoThunks) type instance PreviousEra (AlonzoEra c) = MaryEra c diff --git a/shelley/chain-and-ledger/executable-spec/src/Cardano/Ledger/Shelley.hs b/shelley/chain-and-ledger/executable-spec/src/Cardano/Ledger/Shelley.hs index 16e8ccdadc8..4b441a35a64 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Cardano/Ledger/Shelley.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Cardano/Ledger/Shelley.hs @@ -35,7 +35,7 @@ import Cardano.Ledger.Coin (Coin) import qualified Cardano.Ledger.Core as Core import qualified Cardano.Ledger.Crypto as CryptoClass import Cardano.Ledger.Era (SupportsSegWit (..), ValidateScript (..)) -import qualified Cardano.Ledger.Era as E (Era (Crypto)) +import qualified Cardano.Ledger.Era as E (Era (Crypto), TranslationContext) import Cardano.Ledger.Hashes (EraIndependentAuxiliaryData) import Cardano.Ledger.SafeHash (makeHashWithExplicitProxys) import Cardano.Ledger.Shelley.Constraints @@ -73,6 +73,8 @@ instance CryptoClass.Crypto c => UsesTxOut (ShelleyEra c) where instance CryptoClass.Crypto c => UsesPParams (ShelleyEra c) where mergePPUpdates _ = updatePParams +type instance E.TranslationContext (ShelleyEra c) = () + -------------------------------------------------------------------------------- -- Core instances --------------------------------------------------------------------------------