{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Cardano.Ledger.Mary.TxSeq () where

import Cardano.Ledger.Core (EraSegWits (..))
import Cardano.Ledger.Crypto (Crypto, StandardCrypto)
import Cardano.Ledger.Mary.Era (MaryEra)
import Cardano.Ledger.Mary.Tx ()
import Cardano.Ledger.Shelley.BlockChain (ShelleyTxSeq (..), bbHash, txSeqTxns)

instance Crypto c => EraSegWits (MaryEra c) where
  {-# SPECIALIZE instance EraSegWits (MaryEra StandardCrypto) #-}
  type TxSeq (MaryEra c) = ShelleyTxSeq (MaryEra c)
  fromTxSeq :: TxSeq (MaryEra c) -> StrictSeq (Tx (MaryEra c))
fromTxSeq = forall era. ShelleyTxSeq era -> StrictSeq (ShelleyTx era)
txSeqTxns
  toTxSeq :: StrictSeq (Tx (MaryEra c)) -> TxSeq (MaryEra c)
toTxSeq = forall era.
(EraTx era, Tx era ~ ShelleyTx era, SafeToHash (TxWits era)) =>
StrictSeq (Tx era) -> ShelleyTxSeq era
ShelleyTxSeq
  hashTxSeq :: TxSeq (MaryEra c)
-> Hash (HASH (EraCrypto (MaryEra c))) EraIndependentBlockBody
hashTxSeq = forall era.
Era era =>
ShelleyTxSeq era -> Hash (EraCrypto era) EraIndependentBlockBody
bbHash
  numSegComponents :: Word64
numSegComponents = Word64
3