-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from input-output-hk/newhoggy/delete-TxFeesEx…
…plicitInEra-and-TxFeesImplicitInEra Delete `TxFeesExplicitInEra` and `TxFeesImplicitInEra`
- Loading branch information
Showing
38 changed files
with
515 additions
and
423 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
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
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
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
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
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
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
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
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
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
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,69 @@ | ||
{-# LANGUAGE ConstraintKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
|
||
module Cardano.Api.Eon.ByronEraOnly | ||
( ByronEraOnly(..) | ||
, IsByronEraOnly(..) | ||
, AnyByronEraOnly(..) | ||
, byronEraOnlyConstraints | ||
, byronEraOnlyToCardanoEra | ||
|
||
, ByronEraOnlyConstraints | ||
) where | ||
|
||
import Cardano.Api.Eras.Core | ||
|
||
import Data.Typeable (Typeable) | ||
|
||
class IsByronEraOnly era where | ||
byronEraOnly :: ByronEraOnly era | ||
|
||
data ByronEraOnly era where | ||
ByronEraOnlyByron :: ByronEraOnly ByronEra | ||
|
||
deriving instance Show (ByronEraOnly era) | ||
deriving instance Eq (ByronEraOnly era) | ||
|
||
instance IsByronEraOnly ByronEra where | ||
byronEraOnly = ByronEraOnlyByron | ||
|
||
instance Eon ByronEraOnly where | ||
inEonForEra no yes = \case | ||
ByronEra -> yes ByronEraOnlyByron | ||
ShelleyEra -> no | ||
AllegraEra -> no | ||
MaryEra -> no | ||
AlonzoEra -> no | ||
BabbageEra -> no | ||
ConwayEra -> no | ||
|
||
instance ToCardanoEra ByronEraOnly where | ||
toCardanoEra = \case | ||
ByronEraOnlyByron -> ByronEra | ||
|
||
data AnyByronEraOnly where | ||
AnyByronEraOnly :: ByronEraOnly era -> AnyByronEraOnly | ||
|
||
deriving instance Show AnyByronEraOnly | ||
|
||
type ByronEraOnlyConstraints era = | ||
( IsByronEraOnly era | ||
, IsCardanoEra era | ||
, Typeable era | ||
) | ||
|
||
byronEraOnlyConstraints :: () | ||
=> ByronEraOnly era | ||
-> (ByronEraOnlyConstraints era => a) | ||
-> a | ||
byronEraOnlyConstraints = \case | ||
ByronEraOnlyByron -> id | ||
|
||
byronEraOnlyToCardanoEra :: ByronEraOnly era -> CardanoEra era | ||
byronEraOnlyToCardanoEra = \case | ||
ByronEraOnlyByron -> ByronEra |
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
Oops, something went wrong.