{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
module Cardano.Api.InMode
(
TxInMode (..)
, fromConsensusGenTx
, toConsensusGenTx
, TxIdInMode (..)
, toConsensusTxId
, TxValidationError (..)
, TxValidationErrorInCardanoMode (..)
, fromConsensusApplyTxErr
)
where
import Cardano.Api.Eon.ShelleyBasedEra
import Cardano.Api.Eras
import Cardano.Api.Modes
import Cardano.Api.Orphans ()
import Cardano.Api.Tx.Body
import Cardano.Api.Tx.Sign
import Cardano.Api.Utils (textShow)
import qualified Cardano.Ledger.Api as L
import qualified Ouroboros.Consensus.Byron.Ledger as Consensus
import qualified Ouroboros.Consensus.Cardano.Block as Consensus
import qualified Ouroboros.Consensus.HardFork.Combinator as Consensus
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch)
import qualified Ouroboros.Consensus.Ledger.SupportsMempool as Consensus
import qualified Ouroboros.Consensus.Shelley.HFEras as Consensus
import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import qualified Ouroboros.Consensus.TypeFamilyWrappers as Consensus
import Data.Aeson (ToJSON (..), (.=))
import qualified Data.Aeson as Aeson
import Data.SOP.Strict (NS (S, Z))
import qualified Data.Text as Text
import GHC.Generics
data TxInMode where
TxInMode
:: ShelleyBasedEra era
-> Tx era
-> TxInMode
TxInByronSpecial
:: Consensus.GenTx Consensus.ByronBlock
-> TxInMode
deriving instance Show TxInMode
fromConsensusGenTx
:: ()
=> Consensus.CardanoBlock L.StandardCrypto ~ block
=> Consensus.GenTx block
-> TxInMode
fromConsensusGenTx :: forall block.
(CardanoBlock StandardCrypto ~ block) =>
GenTx block -> TxInMode
fromConsensusGenTx = \case
Consensus.HardForkGenTx (Consensus.OneEraGenTx (Z GenTx x
tx')) ->
GenTx ByronBlock -> TxInMode
TxInByronSpecial GenTx x
GenTx ByronBlock
tx'
Consensus.HardForkGenTx (Consensus.OneEraGenTx (S (Z GenTx x
tx'))) ->
let Consensus.ShelleyTx TxId (EraCrypto (ShelleyEra StandardCrypto))
_txid Tx (ShelleyEra StandardCrypto)
shelleyEraTx = GenTx x
tx'
in ShelleyBasedEra ShelleyEra -> Tx ShelleyEra -> TxInMode
forall era. ShelleyBasedEra era -> Tx era -> TxInMode
TxInMode ShelleyBasedEra ShelleyEra
ShelleyBasedEraShelley (ShelleyBasedEra ShelleyEra
-> Tx (ShelleyLedgerEra ShelleyEra) -> Tx ShelleyEra
forall era.
ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
ShelleyTx ShelleyBasedEra ShelleyEra
ShelleyBasedEraShelley Tx (ShelleyEra StandardCrypto)
Tx (ShelleyLedgerEra ShelleyEra)
shelleyEraTx)
Consensus.HardForkGenTx (Consensus.OneEraGenTx (S (S (Z GenTx x
tx')))) ->
let Consensus.ShelleyTx TxId (EraCrypto (AllegraEra StandardCrypto))
_txid Tx (AllegraEra StandardCrypto)
shelleyEraTx = GenTx x
tx'
in ShelleyBasedEra AllegraEra -> Tx AllegraEra -> TxInMode
forall era. ShelleyBasedEra era -> Tx era -> TxInMode
TxInMode ShelleyBasedEra AllegraEra
ShelleyBasedEraAllegra (ShelleyBasedEra AllegraEra
-> Tx (ShelleyLedgerEra AllegraEra) -> Tx AllegraEra
forall era.
ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
ShelleyTx ShelleyBasedEra AllegraEra
ShelleyBasedEraAllegra Tx (AllegraEra StandardCrypto)
Tx (ShelleyLedgerEra AllegraEra)
shelleyEraTx)
Consensus.HardForkGenTx (Consensus.OneEraGenTx (S (S (S (Z GenTx x
tx'))))) ->
let Consensus.ShelleyTx TxId (EraCrypto (MaryEra StandardCrypto))
_txid Tx (MaryEra StandardCrypto)
shelleyEraTx = GenTx x
tx'
in ShelleyBasedEra MaryEra -> Tx MaryEra -> TxInMode
forall era. ShelleyBasedEra era -> Tx era -> TxInMode
TxInMode ShelleyBasedEra MaryEra
ShelleyBasedEraMary (ShelleyBasedEra MaryEra
-> Tx (ShelleyLedgerEra MaryEra) -> Tx MaryEra
forall era.
ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
ShelleyTx ShelleyBasedEra MaryEra
ShelleyBasedEraMary Tx (MaryEra StandardCrypto)
Tx (ShelleyLedgerEra MaryEra)
shelleyEraTx)
Consensus.HardForkGenTx (Consensus.OneEraGenTx (S (S (S (S (Z GenTx x
tx')))))) ->
let Consensus.ShelleyTx TxId (EraCrypto (AlonzoEra StandardCrypto))
_txid Tx (AlonzoEra StandardCrypto)
shelleyEraTx = GenTx x
tx'
in ShelleyBasedEra AlonzoEra -> Tx AlonzoEra -> TxInMode
forall era. ShelleyBasedEra era -> Tx era -> TxInMode
TxInMode ShelleyBasedEra AlonzoEra
ShelleyBasedEraAlonzo (ShelleyBasedEra AlonzoEra
-> Tx (ShelleyLedgerEra AlonzoEra) -> Tx AlonzoEra
forall era.
ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
ShelleyTx ShelleyBasedEra AlonzoEra
ShelleyBasedEraAlonzo Tx (AlonzoEra StandardCrypto)
Tx (ShelleyLedgerEra AlonzoEra)
shelleyEraTx)
Consensus.HardForkGenTx (Consensus.OneEraGenTx (S (S (S (S (S (Z GenTx x
tx'))))))) ->
let Consensus.ShelleyTx TxId (EraCrypto (BabbageEra StandardCrypto))
_txid Tx (BabbageEra StandardCrypto)
shelleyEraTx = GenTx x
tx'
in ShelleyBasedEra BabbageEra -> Tx BabbageEra -> TxInMode
forall era. ShelleyBasedEra era -> Tx era -> TxInMode
TxInMode ShelleyBasedEra BabbageEra
ShelleyBasedEraBabbage (ShelleyBasedEra BabbageEra
-> Tx (ShelleyLedgerEra BabbageEra) -> Tx BabbageEra
forall era.
ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
ShelleyTx ShelleyBasedEra BabbageEra
ShelleyBasedEraBabbage Tx (BabbageEra StandardCrypto)
Tx (ShelleyLedgerEra BabbageEra)
shelleyEraTx)
Consensus.HardForkGenTx (Consensus.OneEraGenTx (S (S (S (S (S (S (Z GenTx x
tx')))))))) ->
let Consensus.ShelleyTx TxId (EraCrypto (ConwayEra StandardCrypto))
_txid Tx (ConwayEra StandardCrypto)
shelleyEraTx = GenTx x
tx'
in ShelleyBasedEra ConwayEra -> Tx ConwayEra -> TxInMode
forall era. ShelleyBasedEra era -> Tx era -> TxInMode
TxInMode ShelleyBasedEra ConwayEra
ShelleyBasedEraConway (ShelleyBasedEra ConwayEra
-> Tx (ShelleyLedgerEra ConwayEra) -> Tx ConwayEra
forall era.
ShelleyBasedEra era -> Tx (ShelleyLedgerEra era) -> Tx era
ShelleyTx ShelleyBasedEra ConwayEra
ShelleyBasedEraConway Tx (ConwayEra StandardCrypto)
Tx (ShelleyLedgerEra ConwayEra)
shelleyEraTx)
toConsensusGenTx
:: ()
=> Consensus.CardanoBlock L.StandardCrypto ~ block
=> TxInMode
-> Consensus.GenTx block
toConsensusGenTx :: forall block.
(CardanoBlock StandardCrypto ~ block) =>
TxInMode -> GenTx block
toConsensusGenTx (TxInByronSpecial GenTx ByronBlock
gtx) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (GenTx ByronBlock -> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx ByronBlock
gtx))
toConsensusGenTx (TxInMode ShelleyBasedEra era
ShelleyBasedEraShelley (ShelleyTx ShelleyBasedEra era
_ Tx (ShelleyLedgerEra era)
tx)) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (NS GenTx (CardanoShelleyEras StandardCrypto)
-> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (GenTx
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
-> NS GenTx (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
tx')))
where
tx' :: GenTx
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
tx' = Tx (ShelleyEra StandardCrypto)
-> GenTx
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
forall era proto.
ShelleyBasedEra era =>
Tx era -> GenTx (ShelleyBlock proto era)
Consensus.mkShelleyTx Tx (ShelleyEra StandardCrypto)
Tx (ShelleyLedgerEra era)
tx
toConsensusGenTx (TxInMode ShelleyBasedEra era
ShelleyBasedEraAllegra (ShelleyTx ShelleyBasedEra era
_ Tx (ShelleyLedgerEra era)
tx)) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (NS GenTx (CardanoShelleyEras StandardCrypto)
-> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS GenTx (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (GenTx
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
tx'))))
where
tx' :: GenTx
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
tx' = Tx (AllegraEra StandardCrypto)
-> GenTx
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
forall era proto.
ShelleyBasedEra era =>
Tx era -> GenTx (ShelleyBlock proto era)
Consensus.mkShelleyTx Tx (AllegraEra StandardCrypto)
Tx (ShelleyLedgerEra era)
tx
toConsensusGenTx (TxInMode ShelleyBasedEra era
ShelleyBasedEraMary (ShelleyTx ShelleyBasedEra era
_ Tx (ShelleyLedgerEra era)
tx)) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (NS GenTx (CardanoShelleyEras StandardCrypto)
-> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS GenTx (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (GenTx
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
tx')))))
where
tx' :: GenTx
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
tx' = Tx (MaryEra StandardCrypto)
-> GenTx
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
forall era proto.
ShelleyBasedEra era =>
Tx era -> GenTx (ShelleyBlock proto era)
Consensus.mkShelleyTx Tx (MaryEra StandardCrypto)
Tx (ShelleyLedgerEra era)
tx
toConsensusGenTx (TxInMode ShelleyBasedEra era
ShelleyBasedEraAlonzo (ShelleyTx ShelleyBasedEra era
_ Tx (ShelleyLedgerEra era)
tx)) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (NS GenTx (CardanoShelleyEras StandardCrypto)
-> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS GenTx (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (GenTx
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
tx'))))))
where
tx' :: GenTx
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
tx' = Tx (AlonzoEra StandardCrypto)
-> GenTx
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
forall era proto.
ShelleyBasedEra era =>
Tx era -> GenTx (ShelleyBlock proto era)
Consensus.mkShelleyTx Tx (AlonzoEra StandardCrypto)
Tx (ShelleyLedgerEra era)
tx
toConsensusGenTx (TxInMode ShelleyBasedEra era
ShelleyBasedEraBabbage (ShelleyTx ShelleyBasedEra era
_ Tx (ShelleyLedgerEra era)
tx)) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (NS GenTx (CardanoShelleyEras StandardCrypto)
-> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS GenTx (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (GenTx
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
-> NS
GenTx
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
tx')))))))
where
tx' :: GenTx
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
tx' = Tx (BabbageEra StandardCrypto)
-> GenTx
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
forall era proto.
ShelleyBasedEra era =>
Tx era -> GenTx (ShelleyBlock proto era)
Consensus.mkShelleyTx Tx (BabbageEra StandardCrypto)
Tx (ShelleyLedgerEra era)
tx
toConsensusGenTx (TxInMode ShelleyBasedEra era
ShelleyBasedEraConway (ShelleyTx ShelleyBasedEra era
_ Tx (ShelleyLedgerEra era)
tx)) =
OneEraGenTx (CardanoEras StandardCrypto)
-> GenTx (CardanoBlock StandardCrypto)
forall (xs :: [*]). OneEraGenTx xs -> GenTx (HardForkBlock xs)
Consensus.HardForkGenTx (NS GenTx (CardanoEras StandardCrypto)
-> OneEraGenTx (CardanoEras StandardCrypto)
forall (xs :: [*]). NS GenTx xs -> OneEraGenTx xs
Consensus.OneEraGenTx (NS GenTx (CardanoShelleyEras StandardCrypto)
-> NS GenTx (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS GenTx (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
GenTx
'[ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
GenTx
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (GenTx
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
-> NS
GenTx
'[ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z GenTx
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
tx'))))))))
where
tx' :: GenTx
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
tx' = Tx (ConwayEra StandardCrypto)
-> GenTx
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
forall era proto.
ShelleyBasedEra era =>
Tx era -> GenTx (ShelleyBlock proto era)
Consensus.mkShelleyTx Tx (ConwayEra StandardCrypto)
Tx (ShelleyLedgerEra era)
tx
data TxIdInMode where
TxIdInMode
:: CardanoEra era
-> TxId
-> TxIdInMode
toConsensusTxId
:: ()
=> Consensus.CardanoBlock L.StandardCrypto ~ block
=> TxIdInMode
-> Consensus.TxId (Consensus.GenTx block)
toConsensusTxId :: forall block.
(CardanoBlock StandardCrypto ~ block) =>
TxIdInMode -> TxId (GenTx block)
toConsensusTxId (TxIdInMode CardanoEra era
ByronEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto) -> TxId (GenTx block)
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId (OneEraGenTxId (CardanoEras StandardCrypto) -> TxId (GenTx block))
-> (WrapGenTxId ByronBlock
-> OneEraGenTxId (CardanoEras StandardCrypto))
-> WrapGenTxId ByronBlock
-> TxId (GenTx block)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto))
-> (WrapGenTxId ByronBlock
-> NS WrapGenTxId (CardanoEras StandardCrypto))
-> WrapGenTxId ByronBlock
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WrapGenTxId ByronBlock
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (WrapGenTxId ByronBlock -> TxId (GenTx block))
-> WrapGenTxId ByronBlock -> TxId (GenTx block)
forall a b. (a -> b) -> a -> b
$ GenTxId ByronBlock -> WrapGenTxId ByronBlock
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId ByronBlock
txid'
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.ByronBlock)
txid' :: GenTxId ByronBlock
txid' = TxId -> GenTxId ByronBlock
Consensus.ByronTxId (TxId -> GenTxId ByronBlock) -> TxId -> GenTxId ByronBlock
forall a b. (a -> b) -> a -> b
$ TxId -> TxId
toByronTxId TxId
txid
toConsensusTxId (TxIdInMode CardanoEra era
ShelleyEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId (NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
-> NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (GenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
-> WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
txid'))))
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.StandardShelleyBlock)
txid' :: GenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
txid' = TxId (EraCrypto (ShelleyEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
forall proto era.
TxId (EraCrypto era) -> TxId (GenTx (ShelleyBlock proto era))
Consensus.ShelleyTxId (TxId (EraCrypto (ShelleyEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto)))
-> TxId (EraCrypto (ShelleyEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
forall a b. (a -> b) -> a -> b
$ TxId -> TxId StandardCrypto
toShelleyTxId TxId
txid
toConsensusTxId (TxIdInMode CardanoEra era
AllegraEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId (NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
-> WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
txid')))))
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.StandardAllegraBlock)
txid' :: GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
txid' = TxId (EraCrypto (AllegraEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
forall proto era.
TxId (EraCrypto era) -> TxId (GenTx (ShelleyBlock proto era))
Consensus.ShelleyTxId (TxId (EraCrypto (AllegraEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto)))
-> TxId (EraCrypto (AllegraEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
forall a b. (a -> b) -> a -> b
$ TxId -> TxId StandardCrypto
toShelleyTxId TxId
txid
toConsensusTxId (TxIdInMode CardanoEra era
MaryEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId (NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (GenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
-> WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
txid'))))))
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.StandardMaryBlock)
txid' :: GenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
txid' = TxId (EraCrypto (MaryEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
forall proto era.
TxId (EraCrypto era) -> TxId (GenTx (ShelleyBlock proto era))
Consensus.ShelleyTxId (TxId (EraCrypto (MaryEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto)))
-> TxId (EraCrypto (MaryEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
forall a b. (a -> b) -> a -> b
$ TxId -> TxId StandardCrypto
toShelleyTxId TxId
txid
toConsensusTxId (TxIdInMode CardanoEra era
AlonzoEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId
(NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
-> WrapGenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
txid')))))))
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.StandardAlonzoBlock)
txid' :: GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
txid' = TxId (EraCrypto (AlonzoEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
forall proto era.
TxId (EraCrypto era) -> TxId (GenTx (ShelleyBlock proto era))
Consensus.ShelleyTxId (TxId (EraCrypto (AlonzoEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto)))
-> TxId (EraCrypto (AlonzoEra StandardCrypto))
-> GenTxId
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
forall a b. (a -> b) -> a -> b
$ TxId -> TxId StandardCrypto
toShelleyTxId TxId
txid
toConsensusTxId (TxIdInMode CardanoEra era
BabbageEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId
(NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (WrapGenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
-> NS
WrapGenTxId
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (GenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
-> WrapGenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
txid'))))))))
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.StandardBabbageBlock)
txid' :: GenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
txid' = TxId (EraCrypto (BabbageEra StandardCrypto))
-> GenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
forall proto era.
TxId (EraCrypto era) -> TxId (GenTx (ShelleyBlock proto era))
Consensus.ShelleyTxId (TxId (EraCrypto (BabbageEra StandardCrypto))
-> GenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto)))
-> TxId (EraCrypto (BabbageEra StandardCrypto))
-> GenTxId
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
forall a b. (a -> b) -> a -> b
$ TxId -> TxId StandardCrypto
toShelleyTxId TxId
txid
toConsensusTxId (TxIdInMode CardanoEra era
ConwayEra TxId
txid) =
OneEraGenTxId (CardanoEras StandardCrypto)
-> TxId (GenTx (CardanoBlock StandardCrypto))
forall (xs :: [*]).
OneEraGenTxId xs -> TxId (GenTx (HardForkBlock xs))
Consensus.HardForkGenTxId
(NS WrapGenTxId (CardanoEras StandardCrypto)
-> OneEraGenTxId (CardanoEras StandardCrypto)
forall (xs :: [*]). NS WrapGenTxId xs -> OneEraGenTxId xs
Consensus.OneEraGenTxId (NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
-> NS WrapGenTxId (CardanoEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS WrapGenTxId (CardanoShelleyEras StandardCrypto)
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto),
ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (NS
WrapGenTxId
'[ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
-> NS
WrapGenTxId
'[ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto),
ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (xs1 :: [k]) (x :: k).
NS f xs1 -> NS f (x : xs1)
S (WrapGenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
-> NS
WrapGenTxId
'[ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)]
forall {k} (f :: k -> *) (x :: k) (xs1 :: [k]).
f x -> NS f (x : xs1)
Z (GenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
-> WrapGenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
forall blk. GenTxId blk -> WrapGenTxId blk
Consensus.WrapGenTxId GenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
txid')))))))))
where
txid' :: Consensus.TxId (Consensus.GenTx Consensus.StandardConwayBlock)
txid' :: GenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
txid' = TxId (EraCrypto (ConwayEra StandardCrypto))
-> GenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
forall proto era.
TxId (EraCrypto era) -> TxId (GenTx (ShelleyBlock proto era))
Consensus.ShelleyTxId (TxId (EraCrypto (ConwayEra StandardCrypto))
-> GenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)))
-> TxId (EraCrypto (ConwayEra StandardCrypto))
-> GenTxId
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
forall a b. (a -> b) -> a -> b
$ TxId -> TxId StandardCrypto
toShelleyTxId TxId
txid
data TxValidationError era where
ByronTxValidationError
:: Consensus.ApplyTxErr Consensus.ByronBlock
-> TxValidationError era
ShelleyTxValidationError
:: ShelleyBasedEra era
-> Consensus.ApplyTxErr (Consensus.ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
deriving instance Generic (TxValidationError era)
instance Show (TxValidationError era) where
showsPrec :: Int -> TxValidationError era -> ShowS
showsPrec Int
p = \case
ByronTxValidationError ApplyTxErr ByronBlock
err ->
Bool -> ShowS -> ShowS
showParen
(Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
11)
( String -> ShowS
showString String
"ByronTxValidationError "
ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ApplyMempoolPayloadErr -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11 ApplyMempoolPayloadErr
ApplyTxErr ByronBlock
err
)
ShelleyTxValidationError ShelleyBasedEra era
sbe ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
err ->
ShelleyBasedEra era
-> (ShelleyBasedEraConstraints era => ShowS) -> ShowS
forall era a.
ShelleyBasedEra era -> (ShelleyBasedEraConstraints era => a) -> a
shelleyBasedEraConstraints ShelleyBasedEra era
sbe ((ShelleyBasedEraConstraints era => ShowS) -> ShowS)
-> (ShelleyBasedEraConstraints era => ShowS) -> ShowS
forall a b. (a -> b) -> a -> b
$
Bool -> ShowS -> ShowS
showParen
(Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
11)
( String -> ShowS
showString String
"ShelleyTxValidationError "
ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
showString (ShelleyBasedEra era -> String
forall a. Show a => a -> String
show ShelleyBasedEra era
sbe)
ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
showString String
" "
ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ApplyTxError (ShelleyLedgerEra era) -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11 ApplyTxError (ShelleyLedgerEra era)
ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
err
)
instance ToJSON (TxValidationError era) where
toJSON :: TxValidationError era -> Value
toJSON = \case
ByronTxValidationError ApplyTxErr ByronBlock
err ->
[Pair] -> Value
Aeson.object
[ Key
"kind" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
Aeson.String Text
"ByronTxValidationError"
, Key
"error" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ApplyMempoolPayloadErr -> Value
forall a. ToJSON a => a -> Value
toJSON ApplyMempoolPayloadErr
ApplyTxErr ByronBlock
err
]
ShelleyTxValidationError ShelleyBasedEra era
sbe ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
err ->
ShelleyBasedEra era
-> (ShelleyBasedEraConstraints era => Value) -> Value
forall era a.
ShelleyBasedEra era -> (ShelleyBasedEraConstraints era => a) -> a
shelleyBasedEraConstraints ShelleyBasedEra era
sbe ((ShelleyBasedEraConstraints era => Value) -> Value)
-> (ShelleyBasedEraConstraints era => Value) -> Value
forall a b. (a -> b) -> a -> b
$
[Pair] -> Value
Aeson.object
[ Key
"kind" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
Aeson.String Text
"ShelleyTxValidationError"
, Key
"era" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
forall a. ToJSON a => a -> Value
toJSON (String -> Text
Text.pack (ShelleyBasedEra era -> String
forall a. Show a => a -> String
show ShelleyBasedEra era
sbe))
, Key
"error" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> Value
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> Value
appTxErrToJson ShelleyBasedEra era
sbe ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
err
]
appTxErrToJson
:: ()
=> ShelleyBasedEra era
-> Consensus.ApplyTxErr (Consensus.ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> Aeson.Value
appTxErrToJson :: forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> Value
appTxErrToJson ShelleyBasedEra era
w ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
e = ShelleyBasedEra era
-> (ShelleyBasedEraConstraints era => Value) -> Value
forall era a.
ShelleyBasedEra era -> (ShelleyBasedEraConstraints era => a) -> a
shelleyBasedEraConstraints ShelleyBasedEra era
w ((ShelleyBasedEraConstraints era => Value) -> Value)
-> (ShelleyBasedEraConstraints era => Value) -> Value
forall a b. (a -> b) -> a -> b
$ ApplyTxError (ShelleyLedgerEra era) -> Value
forall a. ToJSON a => a -> Value
toJSON ApplyTxError (ShelleyLedgerEra era)
ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
e
data TxValidationErrorInCardanoMode where
TxValidationErrorInCardanoMode
:: ()
=> TxValidationError era
-> TxValidationErrorInCardanoMode
TxValidationEraMismatch
:: ()
=> EraMismatch
-> TxValidationErrorInCardanoMode
deriving instance Show TxValidationErrorInCardanoMode
instance ToJSON TxValidationErrorInCardanoMode where
toJSON :: TxValidationErrorInCardanoMode -> Value
toJSON = \case
TxValidationErrorInCardanoMode TxValidationError era
err ->
[Pair] -> Value
Aeson.object
[ Key
"tag" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
Aeson.String Text
"TxValidationErrorInCardanoMode"
, Key
"contents" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxValidationError era -> Value
forall a. ToJSON a => a -> Value
toJSON TxValidationError era
err
]
TxValidationEraMismatch EraMismatch
err ->
[Pair] -> Value
Aeson.object
[ Key
"tag" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
Aeson.String Text
"TxValidationEraMismatch"
, Key
"contents" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
forall a. ToJSON a => a -> Value
toJSON (EraMismatch -> Text
forall a. Show a => a -> Text
textShow EraMismatch
err)
]
fromConsensusApplyTxErr
:: ()
=> Consensus.CardanoBlock L.StandardCrypto ~ block
=> Consensus.ApplyTxErr block
-> TxValidationErrorInCardanoMode
fromConsensusApplyTxErr :: forall block.
(CardanoBlock StandardCrypto ~ block) =>
ApplyTxErr block -> TxValidationErrorInCardanoMode
fromConsensusApplyTxErr = \case
Consensus.ApplyTxErrByron ApplyTxErr ByronBlock
err ->
TxValidationError Any -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError Any -> TxValidationErrorInCardanoMode)
-> TxValidationError Any -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ApplyTxErr ByronBlock -> TxValidationError Any
forall era. ApplyTxErr ByronBlock -> TxValidationError era
ByronTxValidationError ApplyTxErr ByronBlock
err
Consensus.ApplyTxErrShelley ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
err ->
TxValidationError ShelleyEra -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError ShelleyEra -> TxValidationErrorInCardanoMode)
-> TxValidationError ShelleyEra -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra ShelleyEra
-> ApplyTxErr
(ShelleyBlock
(ConsensusProtocol ShelleyEra) (ShelleyLedgerEra ShelleyEra))
-> TxValidationError ShelleyEra
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
ShelleyTxValidationError ShelleyBasedEra ShelleyEra
ShelleyBasedEraShelley ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto))
ApplyTxErr
(ShelleyBlock
(ConsensusProtocol ShelleyEra) (ShelleyLedgerEra ShelleyEra))
err
Consensus.ApplyTxErrAllegra ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
err ->
TxValidationError AllegraEra -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError AllegraEra -> TxValidationErrorInCardanoMode)
-> TxValidationError AllegraEra -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra AllegraEra
-> ApplyTxErr
(ShelleyBlock
(ConsensusProtocol AllegraEra) (ShelleyLedgerEra AllegraEra))
-> TxValidationError AllegraEra
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
ShelleyTxValidationError ShelleyBasedEra AllegraEra
ShelleyBasedEraAllegra ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto))
ApplyTxErr
(ShelleyBlock
(ConsensusProtocol AllegraEra) (ShelleyLedgerEra AllegraEra))
err
Consensus.ApplyTxErrMary ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
err ->
TxValidationError MaryEra -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError MaryEra -> TxValidationErrorInCardanoMode)
-> TxValidationError MaryEra -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra MaryEra
-> ApplyTxErr
(ShelleyBlock
(ConsensusProtocol MaryEra) (ShelleyLedgerEra MaryEra))
-> TxValidationError MaryEra
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
ShelleyTxValidationError ShelleyBasedEra MaryEra
ShelleyBasedEraMary ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto))
ApplyTxErr
(ShelleyBlock
(ConsensusProtocol MaryEra) (ShelleyLedgerEra MaryEra))
err
Consensus.ApplyTxErrAlonzo ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
err ->
TxValidationError AlonzoEra -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError AlonzoEra -> TxValidationErrorInCardanoMode)
-> TxValidationError AlonzoEra -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra AlonzoEra
-> ApplyTxErr
(ShelleyBlock
(ConsensusProtocol AlonzoEra) (ShelleyLedgerEra AlonzoEra))
-> TxValidationError AlonzoEra
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
ShelleyTxValidationError ShelleyBasedEra AlonzoEra
ShelleyBasedEraAlonzo ApplyTxErr
(ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto))
ApplyTxErr
(ShelleyBlock
(ConsensusProtocol AlonzoEra) (ShelleyLedgerEra AlonzoEra))
err
Consensus.ApplyTxErrBabbage ApplyTxErr
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
err ->
TxValidationError BabbageEra -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError BabbageEra -> TxValidationErrorInCardanoMode)
-> TxValidationError BabbageEra -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra BabbageEra
-> ApplyTxErr
(ShelleyBlock
(ConsensusProtocol BabbageEra) (ShelleyLedgerEra BabbageEra))
-> TxValidationError BabbageEra
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
ShelleyTxValidationError ShelleyBasedEra BabbageEra
ShelleyBasedEraBabbage ApplyTxErr
(ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto))
ApplyTxErr
(ShelleyBlock
(ConsensusProtocol BabbageEra) (ShelleyLedgerEra BabbageEra))
err
Consensus.ApplyTxErrConway ApplyTxErr
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
err ->
TxValidationError ConwayEra -> TxValidationErrorInCardanoMode
forall era. TxValidationError era -> TxValidationErrorInCardanoMode
TxValidationErrorInCardanoMode (TxValidationError ConwayEra -> TxValidationErrorInCardanoMode)
-> TxValidationError ConwayEra -> TxValidationErrorInCardanoMode
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra ConwayEra
-> ApplyTxErr
(ShelleyBlock
(ConsensusProtocol ConwayEra) (ShelleyLedgerEra ConwayEra))
-> TxValidationError ConwayEra
forall era.
ShelleyBasedEra era
-> ApplyTxErr
(ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era))
-> TxValidationError era
ShelleyTxValidationError ShelleyBasedEra ConwayEra
ShelleyBasedEraConway ApplyTxErr
(ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto))
ApplyTxErr
(ShelleyBlock
(ConsensusProtocol ConwayEra) (ShelleyLedgerEra ConwayEra))
err
Consensus.ApplyTxErrWrongEra EraMismatch
err ->
EraMismatch -> TxValidationErrorInCardanoMode
TxValidationEraMismatch EraMismatch
err