{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Allegra.TxOut () where import Cardano.Ledger.Allegra.Era (AllegraEra) import Cardano.Ledger.Allegra.PParams () import Cardano.Ledger.Core import Cardano.Ledger.Shelley.TxOut ( ShelleyTxOut (..), addrEitherShelleyTxOutL, valueEitherShelleyTxOutL, ) import Data.Coerce (coerce) import Lens.Micro ((^.)) instance EraTxOut AllegraEra where type TxOut AllegraEra = ShelleyTxOut AllegraEra mkBasicTxOut :: HasCallStack => Addr -> Value AllegraEra -> TxOut AllegraEra mkBasicTxOut = forall era. (HasCallStack, Era era, Val (Value era)) => Addr -> Value era -> ShelleyTxOut era ShelleyTxOut upgradeTxOut :: EraTxOut (PreviousEra AllegraEra) => TxOut (PreviousEra AllegraEra) -> TxOut AllegraEra upgradeTxOut (TxOutCompact CompactAddr addr CompactForm (Value ShelleyEra) cfval) = forall era. CompactAddr -> CompactForm (Value era) -> ShelleyTxOut era TxOutCompact (coerce :: forall a b. Coercible a b => a -> b coerce CompactAddr addr) CompactForm (Value ShelleyEra) cfval addrEitherTxOutL :: Lens' (TxOut AllegraEra) (Either Addr CompactAddr) addrEitherTxOutL = forall era. Lens' (ShelleyTxOut era) (Either Addr CompactAddr) addrEitherShelleyTxOutL {-# INLINE addrEitherTxOutL #-} valueEitherTxOutL :: Lens' (TxOut AllegraEra) (Either (Value AllegraEra) (CompactForm (Value AllegraEra))) valueEitherTxOutL = forall era. Val (Value era) => Lens' (ShelleyTxOut era) (Either (Value era) (CompactForm (Value era))) valueEitherShelleyTxOutL {-# INLINE valueEitherTxOutL #-} getMinCoinTxOut :: PParams AllegraEra -> TxOut AllegraEra -> Coin getMinCoinTxOut PParams AllegraEra pp TxOut AllegraEra _txOut = PParams AllegraEra pp forall s a. s -> Getting a s a -> a ^. forall era. (EraPParams era, ProtVerAtMost era 4) => Lens' (PParams era) Coin ppMinUTxOValueL