Skip to content

Commit

Permalink
Delete unused code in Cardano.Api.Extra.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Dec 15, 2023
1 parent df81217 commit c0bf3d3
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions lib/wallet/src/Cardano/Api/Extra.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE Rank2Types #-}

-- |
Expand All @@ -9,36 +8,15 @@
-- Module containing extra 'Cardano.Api' functionality needed by the wallet.
module Cardano.Api.Extra
( inAnyCardanoEra
, unbundleLedgerShelleyBasedProtocolParams
) where

import Cardano.Api
( BundledProtocolParameters (..)
, InAnyCardanoEra (..)
( InAnyCardanoEra (..)
, IsCardanoEra (cardanoEra)
, ShelleyBasedEra (..)
, Tx
)
import Cardano.Api.Shelley
( ShelleyLedgerEra
)

import qualified Cardano.Ledger.Core as Ledger

-- | Helper function for more easily creating an existential
-- @InAnyCardanoEra Tx@.
inAnyCardanoEra :: IsCardanoEra era => Tx era -> InAnyCardanoEra Tx
inAnyCardanoEra = InAnyCardanoEra cardanoEra

-- Not exposed by cardano-api
unbundleLedgerShelleyBasedProtocolParams
:: ShelleyBasedEra era
-> BundledProtocolParameters era
-> Ledger.PParams (ShelleyLedgerEra era)
unbundleLedgerShelleyBasedProtocolParams = \case
ShelleyBasedEraShelley -> \(BundleAsShelleyBasedProtocolParameters _ _ lpp) -> lpp
ShelleyBasedEraAllegra -> \(BundleAsShelleyBasedProtocolParameters _ _ lpp) -> lpp
ShelleyBasedEraMary -> \(BundleAsShelleyBasedProtocolParameters _ _ lpp) -> lpp
ShelleyBasedEraAlonzo -> \(BundleAsShelleyBasedProtocolParameters _ _ lpp) -> lpp
ShelleyBasedEraBabbage -> \(BundleAsShelleyBasedProtocolParameters _ _ lpp) -> lpp
ShelleyBasedEraConway -> \(BundleAsShelleyBasedProtocolParameters _ _ lpp) -> lpp

0 comments on commit c0bf3d3

Please sign in to comment.