-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08f877f
commit 0cf77ab
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE NoMonomorphismRestriction #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
{-# LANGUAGE UndecidableInstances #-} | ||
|
||
-- | | ||
-- Copyright: © 2020-2022 IOHK | ||
-- License: Apache-2.0 | ||
-- | ||
-- Raw era-dependent tx output | ||
-- | ||
|
||
module Cardano.Read.Ledger.Tx.Output | ||
( OutputType | ||
, Output (..) | ||
) | ||
where | ||
|
||
import Prelude | ||
|
||
import Cardano.Ledger.Alonzo.TxOut | ||
( AlonzoTxOut | ||
) | ||
import Cardano.Ledger.Babbage.TxOut | ||
( BabbageTxOut | ||
) | ||
import Cardano.Ledger.Shelley.TxOut | ||
( ShelleyTxOut | ||
) | ||
import Cardano.Wallet.Read.Eras | ||
( Allegra | ||
, Alonzo | ||
, Babbage | ||
, Byron | ||
, Conway | ||
, Mary | ||
, Shelley | ||
) | ||
|
||
import qualified Cardano.Chain.UTxO as BY | ||
|
||
type family OutputType era where | ||
OutputsType Byron = BY.TxOut | ||
OutputsType Shelley = ShelleyTxOut Shelley | ||
OutputsType Allegra = ShelleyTxOut Allegra | ||
OutputsType Mary = ShelleyTxOut Mary | ||
OutputsType Alonzo = AlonzoTxOut Alonzo | ||
OutputsType Babbage = BabbageTxOut Babbage | ||
OutputsType Conway = BabbageTxOut Conway | ||
|
||
newtype Output era = Output (OutputType era) | ||
|
||
deriving instance Show (OutputType era) => Show (Output era) | ||
deriving instance Eq (OutputType era) => Eq (Output era) |