Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (ShelleyEraTxCert era, EraTxBody era, ProtVerAtMost era 8) ⇒ ShelleyEraTxBody era where
- ttlTxBodyL ∷ ExactEra ShelleyEra era ⇒ Lens' (TxBody era) SlotNo
- updateTxBodyL ∷ Lens' (TxBody era) (StrictMaybe (Update era))
- newtype Withdrawals c = Withdrawals {
- unWithdrawals ∷ Map (RewardAccount c) Coin
- class EraTxCert era ⇒ ShelleyEraTxCert era where
- mkRegTxCert ∷ StakeCredential (EraCrypto era) → TxCert era
- getRegTxCert ∷ TxCert era → Maybe (StakeCredential (EraCrypto era))
- mkUnRegTxCert ∷ StakeCredential (EraCrypto era) → TxCert era
- getUnRegTxCert ∷ TxCert era → Maybe (StakeCredential (EraCrypto era))
- mkDelegStakeTxCert ∷ StakeCredential (EraCrypto era) → KeyHash 'StakePool (EraCrypto era) → TxCert era
- getDelegStakeTxCert ∷ TxCert era → Maybe (StakeCredential (EraCrypto era), KeyHash 'StakePool (EraCrypto era))
- mkGenesisDelegTxCert ∷ ProtVerAtMost era 8 ⇒ GenesisDelegCert (EraCrypto era) → TxCert era
- getGenesisDelegTxCert ∷ ProtVerAtMost era 8 ⇒ TxCert era → Maybe (GenesisDelegCert (EraCrypto era))
- mkMirTxCert ∷ ProtVerAtMost era 8 ⇒ MIRCert (EraCrypto era) → TxCert era
- getMirTxCert ∷ ProtVerAtMost era 8 ⇒ TxCert era → Maybe (MIRCert (EraCrypto era))
- pattern MirTxCert ∷ (ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ MIRCert (EraCrypto era) → TxCert era
- data MIRCert c = MIRCert {
- mirPot ∷ !MIRPot
- mirRewards ∷ !(MIRTarget c)
- data MIRPot
- data MIRTarget c
- = StakeAddressesMIR !(Map (Credential 'Staking c) DeltaCoin)
- | SendToOppositePotMIR !Coin
- pattern GenesisDelegTxCert ∷ (ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ KeyHash 'Genesis (EraCrypto era) → KeyHash 'GenesisDelegate (EraCrypto era) → VRFVerKeyHash 'GenDelegVRF (EraCrypto era) → TxCert era
- pattern RegTxCert ∷ ShelleyEraTxCert era ⇒ StakeCredential (EraCrypto era) → TxCert era
- pattern UnRegTxCert ∷ ShelleyEraTxCert era ⇒ StakeCredential (EraCrypto era) → TxCert era
- pattern DelegStakeTxCert ∷ ShelleyEraTxCert era ⇒ StakeCredential (EraCrypto era) → KeyHash 'StakePool (EraCrypto era) → TxCert era
- txIdTxBody ∷ EraTxBody era ⇒ TxBody era → TxId (EraCrypto era)
- txIdTx ∷ EraTx era ⇒ Tx era → TxId (EraCrypto era)
- bBodySize ∷ EraSegWits era ⇒ ProtVer → TxSeq era → Int
- hashScript ∷ EraScript era ⇒ Script era → ScriptHash (EraCrypto era)
- isNativeScript ∷ EraScript era ⇒ Script era → Bool
- hashScriptTxWitsL ∷ EraTxWits era ⇒ Lens (TxWits era) (TxWits era) (Map (ScriptHash (EraCrypto era)) (Script era)) [Script era]
- mkCoinTxOut ∷ EraTxOut era ⇒ Addr (EraCrypto era) → Coin → TxOut era
- isAdaOnlyTxOutF ∷ EraTxOut era ⇒ SimpleGetter (TxOut era) Bool
- compactCoinTxOutL ∷ (HasCallStack, EraTxOut era) ⇒ Lens' (TxOut era) (CompactForm Coin)
- coinTxOutL ∷ (HasCallStack, EraTxOut era) ⇒ Lens' (TxOut era) Coin
- bootAddrTxOutF ∷ EraTxOut era ⇒ SimpleGetter (TxOut era) (Maybe (BootstrapAddress (EraCrypto era)))
- type family TxUpgradeError era
- type family Tx era = (r ∷ Type) | r → era
- class (EraTxBody era, EraTxWits era, EraTxAuxData era, EraPParams era, NoThunks (Tx era), DecCBOR (Annotator (Tx era)), EncCBOR (Tx era), ToCBOR (Tx era), Show (Tx era), Eq (Tx era), EqRaw (Tx era)) ⇒ EraTx era where
- type Tx era = (r ∷ Type) | r → era
- type TxUpgradeError era
- mkBasicTx ∷ TxBody era → Tx era
- bodyTxL ∷ Lens' (Tx era) (TxBody era)
- witsTxL ∷ Lens' (Tx era) (TxWits era)
- auxDataTxL ∷ Lens' (Tx era) (StrictMaybe (TxAuxData era))
- sizeTxF ∷ SimpleGetter (Tx era) Integer
- wireSizeTxF ∷ SimpleGetter (Tx era) Word32
- validateNativeScript ∷ Tx era → NativeScript era → Bool
- getMinFeeTx ∷ PParams era → Tx era → Int → Coin
- upgradeTx ∷ Tx (PreviousEra era) → Either (TxUpgradeError era) (Tx era)
- type family TxBodyUpgradeError era
- type family TxBody era = (r ∷ Type) | r → era
- class (EraTxOut era, EraTxCert era, EraPParams era, HashAnnotated (TxBody era) EraIndependentTxBody (EraCrypto era), DecCBOR (Annotator (TxBody era)), EncCBOR (TxBody era), ToCBOR (TxBody era), NoThunks (TxBody era), NFData (TxBody era), Show (TxBody era), Eq (TxBody era), EqRaw (TxBody era)) ⇒ EraTxBody era where
- type TxBody era = (r ∷ Type) | r → era
- type TxBodyUpgradeError era
- mkBasicTxBody ∷ TxBody era
- inputsTxBodyL ∷ Lens' (TxBody era) (Set (TxIn (EraCrypto era)))
- outputsTxBodyL ∷ Lens' (TxBody era) (StrictSeq (TxOut era))
- feeTxBodyL ∷ Lens' (TxBody era) Coin
- withdrawalsTxBodyL ∷ Lens' (TxBody era) (Withdrawals (EraCrypto era))
- auxDataHashTxBodyL ∷ Lens' (TxBody era) (StrictMaybe (AuxiliaryDataHash (EraCrypto era)))
- spendableInputsTxBodyF ∷ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era)))
- allInputsTxBodyF ∷ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era)))
- certsTxBodyL ∷ Lens' (TxBody era) (StrictSeq (TxCert era))
- getTotalDepositsTxBody ∷ PParams era → (KeyHash 'StakePool (EraCrypto era) → Bool) → TxBody era → Coin
- getTotalRefundsTxBody ∷ PParams era → (Credential 'Staking (EraCrypto era) → Maybe Coin) → (Credential 'DRepRole (EraCrypto era) → Maybe Coin) → TxBody era → Coin
- getGenesisKeyHashCountTxBody ∷ TxBody era → Int
- upgradeTxBody ∷ TxBody (PreviousEra era) → Either (TxBodyUpgradeError era) (TxBody era)
- type family TxOut era = (r ∷ Type) | r → era
- class (Val (Value era), ToJSON (TxOut era), DecCBOR (Value era), DecCBOR (CompactForm (Value era)), EncCBOR (Value era), ToCBOR (TxOut era), EncCBOR (TxOut era), DecCBOR (TxOut era), DecShareCBOR (TxOut era), Share (TxOut era) ~ Interns (Credential 'Staking (EraCrypto era)), NoThunks (TxOut era), NFData (TxOut era), Show (TxOut era), Eq (TxOut era), EraPParams era) ⇒ EraTxOut era where
- type TxOut era = (r ∷ Type) | r → era
- mkBasicTxOut ∷ Addr (EraCrypto era) → Value era → TxOut era
- upgradeTxOut ∷ TxOut (PreviousEra era) → TxOut era
- valueTxOutL ∷ Lens' (TxOut era) (Value era)
- compactValueTxOutL ∷ Lens' (TxOut era) (CompactForm (Value era))
- valueEitherTxOutL ∷ Lens' (TxOut era) (Either (Value era) (CompactForm (Value era)))
- addrTxOutL ∷ Lens' (TxOut era) (Addr (EraCrypto era))
- compactAddrTxOutL ∷ Lens' (TxOut era) (CompactAddr (EraCrypto era))
- addrEitherTxOutL ∷ Lens' (TxOut era) (Either (Addr (EraCrypto era)) (CompactAddr (EraCrypto era)))
- getMinCoinSizedTxOut ∷ PParams era → Sized (TxOut era) → Coin
- getMinCoinTxOut ∷ PParams era → TxOut era → Coin
- type family Value era
- type family TxAuxData era = (r ∷ Type) | r → era
- class (Era era, Eq (TxAuxData era), EqRaw (TxAuxData era), Show (TxAuxData era), NoThunks (TxAuxData era), ToCBOR (TxAuxData era), EncCBOR (TxAuxData era), DecCBOR (Annotator (TxAuxData era)), HashAnnotated (TxAuxData era) EraIndependentTxAuxData (EraCrypto era)) ⇒ EraTxAuxData era where
- type TxAuxData era = (r ∷ Type) | r → era
- mkBasicTxAuxData ∷ TxAuxData era
- metadataTxAuxDataL ∷ Lens' (TxAuxData era) (Map Word64 Metadatum)
- upgradeTxAuxData ∷ TxAuxData (PreviousEra era) → TxAuxData era
- hashTxAuxData ∷ TxAuxData era → AuxiliaryDataHash (EraCrypto era)
- validateTxAuxData ∷ ProtVer → TxAuxData era → Bool
- type family TxWits era = (r ∷ Type) | r → era
- class (EraScript era, Eq (TxWits era), EqRaw (TxWits era), Show (TxWits era), Monoid (TxWits era), NoThunks (TxWits era), ToCBOR (TxWits era), EncCBOR (TxWits era), DecCBOR (Annotator (TxWits era))) ⇒ EraTxWits era where
- type TxWits era = (r ∷ Type) | r → era
- mkBasicTxWits ∷ TxWits era
- addrTxWitsL ∷ Lens' (TxWits era) (Set (WitVKey 'Witness (EraCrypto era)))
- bootAddrTxWitsL ∷ Lens' (TxWits era) (Set (BootstrapWitness (EraCrypto era)))
- scriptTxWitsL ∷ Lens' (TxWits era) (Map (ScriptHash (EraCrypto era)) (Script era))
- upgradeTxWits ∷ TxWits (PreviousEra era) → TxWits era
- type family NativeScript era = (r ∷ Type) | r → era
- type family Script era = (r ∷ Type) | r → era
- class (Era era, Show (Script era), Eq (Script era), EqRaw (Script era), ToCBOR (Script era), EncCBOR (Script era), DecCBOR (Annotator (Script era)), NoThunks (Script era), SafeToHash (Script era), Eq (NativeScript era), Show (NativeScript era), NFData (NativeScript era), NoThunks (NativeScript era), EncCBOR (NativeScript era), DecCBOR (Annotator (NativeScript era))) ⇒ EraScript era where
- type Script era = (r ∷ Type) | r → era
- type NativeScript era = (r ∷ Type) | r → era
- upgradeScript ∷ Script (PreviousEra era) → Script era
- scriptPrefixTag ∷ Script era → ByteString
- getNativeScript ∷ Script era → Maybe (NativeScript era)
- fromNativeScript ∷ NativeScript era → Script era
- type family TxSeq era = (r ∷ Type) | r → era
- class (EraTx era, Eq (TxSeq era), Show (TxSeq era), EncCBORGroup (TxSeq era), DecCBOR (Annotator (TxSeq era))) ⇒ EraSegWits era where
- isUnRegStakeTxCert ∷ EraTxCert era ⇒ TxCert era → Bool
- isRegStakeTxCert ∷ EraTxCert era ⇒ TxCert era → Bool
- poolCertKeyHashWitness ∷ PoolCert c → KeyHash 'Witness c
- getPoolCertTxCert ∷ EraTxCert era ⇒ TxCert era → Maybe (PoolCert (EraCrypto era))
- pattern RegPoolTxCert ∷ EraTxCert era ⇒ PoolParams (EraCrypto era) → TxCert era
- pattern RetirePoolTxCert ∷ EraTxCert era ⇒ KeyHash 'StakePool (EraCrypto era) → EpochNo → TxCert era
- type family TxCertUpgradeError era
- type family TxCert era = (r ∷ Type) | r → era
- class (Era era, ToJSON (TxCert era), DecCBOR (TxCert era), EncCBOR (TxCert era), ToCBOR (TxCert era), FromCBOR (TxCert era), NoThunks (TxCert era), NFData (TxCert era), Show (TxCert era), Ord (TxCert era), Eq (TxCert era)) ⇒ EraTxCert era where
- type TxCert era = (r ∷ Type) | r → era
- type TxCertUpgradeError era
- upgradeTxCert ∷ TxCert (PreviousEra era) → Either (TxCertUpgradeError era) (TxCert era)
- getVKeyWitnessTxCert ∷ TxCert era → Maybe (KeyHash 'Witness (EraCrypto era))
- getScriptWitnessTxCert ∷ TxCert era → Maybe (ScriptHash (EraCrypto era))
- mkRegPoolTxCert ∷ PoolParams (EraCrypto era) → TxCert era
- getRegPoolTxCert ∷ TxCert era → Maybe (PoolParams (EraCrypto era))
- mkRetirePoolTxCert ∷ KeyHash 'StakePool (EraCrypto era) → EpochNo → TxCert era
- getRetirePoolTxCert ∷ TxCert era → Maybe (KeyHash 'StakePool (EraCrypto era), EpochNo)
- lookupRegStakeTxCert ∷ TxCert era → Maybe (Credential 'Staking (EraCrypto era))
- lookupUnRegStakeTxCert ∷ TxCert era → Maybe (Credential 'Staking (EraCrypto era))
- getTotalDepositsTxCerts ∷ Foldable f ⇒ PParams era → (KeyHash 'StakePool (EraCrypto era) → Bool) → f (TxCert era) → Coin
- getTotalRefundsTxCerts ∷ Foldable f ⇒ PParams era → (Credential 'Staking (EraCrypto era) → Maybe Coin) → (Credential 'DRepRole (EraCrypto era) → Maybe Coin) → f (TxCert era) → Coin
- data PoolCert c
- = RegPool !(PoolParams c)
- | RetirePool !(KeyHash 'StakePool c) !EpochNo
- makePParamMap ∷ [PParam era] → Map Word (PParam era)
- downgradePParamsUpdate ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ DowngradePParams StrictMaybe era → PParamsUpdate era → PParamsUpdate (PreviousEra era)
- upgradePParamsUpdate ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ UpgradePParams StrictMaybe era → PParamsUpdate (PreviousEra era) → PParamsUpdate era
- downgradePParams ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ DowngradePParams Identity era → PParams era → PParams (PreviousEra era)
- upgradePParams ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ UpgradePParams Identity era → PParams (PreviousEra era) → PParams era
- mapPParamsUpdate ∷ (PParamsHKD StrictMaybe era1 → PParamsHKD StrictMaybe era2) → PParamsUpdate era1 → PParamsUpdate era2
- mapPParams ∷ (PParamsHKD Identity era1 → PParamsHKD Identity era2) → PParams era1 → PParams era2
- ppuMinPoolCostL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin)
- ppuMinUTxOValueL ∷ (EraPParams era, ProtVerAtMost era 4) ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin)
- ppuExtraEntropyL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParamsUpdate era) (StrictMaybe Nonce)
- ppuDL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
- ppuTauL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
- ppuRhoL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
- ppuA0L ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe NonNegativeInterval)
- ppuNOptL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Natural)
- ppuEMaxL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe EpochInterval)
- ppuPoolDepositL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin)
- ppuKeyDepositL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin)
- ppuMaxBHSizeL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Word16)
- ppuMaxTxSizeL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Word32)
- ppuMaxBBSizeL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Word32)
- ppuMinFeeBL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin)
- ppuMinFeeAL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin)
- ppMinPoolCostL ∷ EraPParams era ⇒ Lens' (PParams era) Coin
- ppMinUTxOValueL ∷ (EraPParams era, ProtVerAtMost era 4) ⇒ Lens' (PParams era) Coin
- ppExtraEntropyL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParams era) Nonce
- ppDL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParams era) UnitInterval
- ppTauL ∷ EraPParams era ⇒ Lens' (PParams era) UnitInterval
- ppRhoL ∷ EraPParams era ⇒ Lens' (PParams era) UnitInterval
- ppA0L ∷ EraPParams era ⇒ Lens' (PParams era) NonNegativeInterval
- ppNOptL ∷ EraPParams era ⇒ Lens' (PParams era) Natural
- ppEMaxL ∷ EraPParams era ⇒ Lens' (PParams era) EpochInterval
- ppPoolDepositL ∷ EraPParams era ⇒ Lens' (PParams era) Coin
- ppKeyDepositL ∷ EraPParams era ⇒ Lens' (PParams era) Coin
- ppMaxBHSizeL ∷ EraPParams era ⇒ Lens' (PParams era) Word16
- ppMaxTxSizeL ∷ EraPParams era ⇒ Lens' (PParams era) Word32
- ppMaxBBSizeL ∷ EraPParams era ⇒ Lens' (PParams era) Word32
- ppMinFeeBL ∷ EraPParams era ⇒ Lens' (PParams era) Coin
- ppMinFeeAL ∷ EraPParams era ⇒ Lens' (PParams era) Coin
- ppuLens ∷ Lens' (PParamsUpdate era) (PParamsHKD StrictMaybe era)
- ppLens ∷ Lens' (PParams era) (PParamsHKD Identity era)
- emptyPParamsUpdate ∷ EraPParams era ⇒ PParamsUpdate era
- emptyPParams ∷ EraPParams era ⇒ PParams era
- genericApplyPPUpdates ∷ (Generic (PParamsHKD Identity era), Generic (PParamsHKD StrictMaybe era), Updatable (Rep (PParamsHKD Identity era) a) (Rep (PParamsHKD StrictMaybe era) u)) ⇒ PParams era → PParamsUpdate era → PParams era
- newtype PParams era = PParams (PParamsHKD Identity era)
- newtype PParamsUpdate era = PParamsUpdate (PParamsHKD StrictMaybe era)
- type family DowngradePParams (f ∷ Type → Type) era
- type family UpgradePParams (f ∷ Type → Type) era
- type family PParamsHKD (f ∷ Type → Type) era = (r ∷ Type) | r → era
- class (Era era, Eq (PParamsHKD Identity era), Ord (PParamsHKD Identity era), Show (PParamsHKD Identity era), NFData (PParamsHKD Identity era), EncCBOR (PParamsHKD Identity era), DecCBOR (PParamsHKD Identity era), ToCBOR (PParamsHKD Identity era), FromCBOR (PParamsHKD Identity era), NoThunks (PParamsHKD Identity era), ToJSON (PParamsHKD Identity era), FromJSON (PParamsHKD Identity era), Eq (PParamsHKD StrictMaybe era), Ord (PParamsHKD StrictMaybe era), Show (PParamsHKD StrictMaybe era), NFData (PParamsHKD StrictMaybe era), EncCBOR (PParamsHKD StrictMaybe era), DecCBOR (PParamsHKD StrictMaybe era), ToCBOR (PParamsHKD StrictMaybe era), FromCBOR (PParamsHKD StrictMaybe era), NoThunks (PParamsHKD StrictMaybe era), ToJSON (PParamsHKD StrictMaybe era)) ⇒ EraPParams era where
- type PParamsHKD (f ∷ Type → Type) era = (r ∷ Type) | r → era
- type UpgradePParams (f ∷ Type → Type) era
- type DowngradePParams (f ∷ Type → Type) era
- applyPPUpdates ∷ PParams era → PParamsUpdate era → PParams era
- ppDG ∷ SimpleGetter (PParams era) UnitInterval
- ppProtocolVersionL ∷ Lens' (PParams era) ProtVer
- ppuProtocolVersionL ∷ Lens' (PParamsUpdate era) (StrictMaybe ProtVer)
- data PParam era where
- PParam ∷ ∀ t era. ToPlutusData t ⇒ Word → Lens' (PParamsUpdate era) (StrictMaybe t) → PParam era
- data RewardType
- data Reward c = Reward {
- rewardType ∷ !RewardType
- rewardPool ∷ !(KeyHash 'StakePool c)
- rewardAmount ∷ !Coin
- data EraIndependentTxBody
- data EraIndependentBlockHeader
- data EraIndependentBlockBody
- data EraIndependentMetadata
- data EraIndependentTxAuxData
- data EraIndependentScript
- data EraIndependentData
- type DataHash c = SafeHash c EraIndependentData
- data EraIndependentScriptData
- data EraIndependentPParamView
- data EraIndependentScriptIntegrity
- newtype ScriptHash c = ScriptHash (Hash (ADDRHASH c) EraIndependentScript)
- translateEraThroughCBOR ∷ (Era era, ToCBOR (ti (PreviousEra era)), DecCBOR (Annotator (to era))) ⇒ Text → ti (PreviousEra era) → Except DecoderError (to era)
- translateEraMaybe ∷ (TranslateEra era f, TranslationError era f ~ ()) ⇒ TranslationContext era → f (PreviousEra era) → Maybe (f era)
- translateEra' ∷ (TranslateEra era f, TranslationError era f ~ Void) ⇒ TranslationContext era → f (PreviousEra era) → f era
- type family TranslationContext era
- type family TranslationError era (f ∷ Type → TYPE LiftedRep)
- class (Era era, Era (PreviousEra era)) ⇒ TranslateEra era (f ∷ Type → TYPE LiftedRep) where
- type TranslationError era (f ∷ Type → TYPE LiftedRep)
- translateEra ∷ TranslationContext era → f (PreviousEra era) → Except (TranslationError era f) (f era)
- eraDecoder ∷ ∀ era t s. Era era ⇒ Decoder s t → Decoder s t
- fromEraShareCBOR ∷ (Era era, DecShareCBOR t) ⇒ Decoder s t
- fromEraCBOR ∷ (Era era, DecCBOR t) ⇒ Decoder s t
- toEraCBOR ∷ (Era era, EncCBOR t) ⇒ t → Encoding
- notSupportedInThisEraL ∷ HasCallStack ⇒ Lens' a b
- notSupportedInThisEra ∷ HasCallStack ⇒ a
- atMostEra ∷ ∀ (eraName ∷ Type → Type) era. AtMostEra eraName era ⇒ ()
- atLeastEra ∷ ∀ (eraName ∷ Type → Type) era. AtLeastEra eraName era ⇒ ()
- eraProtVersions ∷ Era era ⇒ [Version]
- eraProtVerHigh ∷ Era era ⇒ Version
- eraProtVerLow ∷ Era era ⇒ Version
- absurdEraRule ∷ ∀ (rule ∷ Symbol) era a. VoidEraRule rule era → a
- type family ProtVerHigh era ∷ Nat
- type family ProtVerLow era ∷ Nat
- type family PreviousEra era = (r ∷ Type) | r → era
- type family EraCrypto era
- class (Crypto (EraCrypto era), Typeable era, KnownNat (ProtVerLow era), KnownNat (ProtVerHigh era), ProtVerLow era <= ProtVerHigh era, MinVersion <= ProtVerLow era, MinVersion <= ProtVerHigh era, CmpNat (ProtVerLow era) MaxVersion ~ 'LT, CmpNat (ProtVerHigh era) MaxVersion ~ 'LT, ProtVerLow era <= MaxVersion, ProtVerHigh era <= MaxVersion) ⇒ Era era where
- type EraCrypto era
- type PreviousEra era = (r ∷ Type) | r → era
- type ProtVerLow era ∷ Nat
- type ProtVerHigh era ∷ Nat
- eraName ∷ String
- data ByronEra c
- type family EraRule (rule ∷ Symbol) era = (r ∷ Type) | r → rule
- type family EraRuleFailure (rule ∷ Symbol) era = (r ∷ Type) | r → rule era
- type family EraRuleEvent (rule ∷ Symbol) era = (r ∷ Type) | r → rule era
- data VoidEraRule (rule ∷ Symbol) era
- class EraRuleFailure rule era ~ PredicateFailure (EraRule rule era) ⇒ InjectRuleFailure (rule ∷ Symbol) (t ∷ Type → TYPE LiftedRep) era where
- injectFailure ∷ t era → EraRuleFailure rule era
- class EraRuleEvent rule era ~ Event (EraRule rule era) ⇒ InjectRuleEvent (rule ∷ Symbol) (t ∷ Type → TYPE LiftedRep) era where
- injectEvent ∷ t era → EraRuleEvent rule era
- type family ProtVerAtLeast era (l ∷ Nat) where ...
- type family ProtVerAtMost era (h ∷ Nat) where ...
- type ProtVerInBounds era (l ∷ Nat) (h ∷ Nat) = (ProtVerAtLeast era l, ProtVerAtMost era h)
- type ExactEra (inEra ∷ Type → Type) era = ProtVerInBounds era (ProtVerLow (inEra (EraCrypto era))) (ProtVerHigh (inEra (EraCrypto era)))
- type AtLeastEra (eraName ∷ Type → Type) era = ProtVerAtLeast era (ProtVerLow (eraName (EraCrypto era)))
- type AtMostEra (eraName ∷ Type → Type) era = ProtVerAtMost era (ProtVerHigh (eraName (EraCrypto era)))
- module Cardano.Ledger.Shelley.Governance
Documentation
class (ShelleyEraTxCert era, EraTxBody era, ProtVerAtMost era 8) ⇒ ShelleyEraTxBody era where Source #
ttlTxBodyL ∷ ExactEra ShelleyEra era ⇒ Lens' (TxBody era) SlotNo Source #
updateTxBodyL ∷ Lens' (TxBody era) (StrictMaybe (Update era)) Source #
Instances
Crypto c ⇒ ShelleyEraTxBody (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxBody ttlTxBodyL ∷ Lens' (TxBody (ShelleyEra c)) SlotNo Source # updateTxBodyL ∷ Lens' (TxBody (ShelleyEra c)) (StrictMaybe (Update (ShelleyEra c))) Source # |
newtype Withdrawals c Source #
This is called wdrl
in the spec.
Instances
class EraTxCert era ⇒ ShelleyEraTxCert era where Source #
mkRegTxCert ∷ StakeCredential (EraCrypto era) → TxCert era Source #
getRegTxCert ∷ TxCert era → Maybe (StakeCredential (EraCrypto era)) Source #
mkUnRegTxCert ∷ StakeCredential (EraCrypto era) → TxCert era Source #
getUnRegTxCert ∷ TxCert era → Maybe (StakeCredential (EraCrypto era)) Source #
mkDelegStakeTxCert ∷ StakeCredential (EraCrypto era) → KeyHash 'StakePool (EraCrypto era) → TxCert era Source #
getDelegStakeTxCert ∷ TxCert era → Maybe (StakeCredential (EraCrypto era), KeyHash 'StakePool (EraCrypto era)) Source #
mkGenesisDelegTxCert ∷ ProtVerAtMost era 8 ⇒ GenesisDelegCert (EraCrypto era) → TxCert era Source #
getGenesisDelegTxCert ∷ ProtVerAtMost era 8 ⇒ TxCert era → Maybe (GenesisDelegCert (EraCrypto era)) Source #
mkMirTxCert ∷ ProtVerAtMost era 8 ⇒ MIRCert (EraCrypto era) → TxCert era Source #
getMirTxCert ∷ ProtVerAtMost era 8 ⇒ TxCert era → Maybe (MIRCert (EraCrypto era)) Source #
Instances
pattern MirTxCert ∷ (ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ MIRCert (EraCrypto era) → TxCert era Source #
Move instantaneous rewards certificate
MIRCert | |
|
Instances
Crypto c ⇒ ToJSON (MIRCert c) Source # | |
Generic (MIRCert c) Source # | |
Show (MIRCert c) Source # | |
Crypto c ⇒ DecCBOR (MIRCert c) Source # | |
Crypto c ⇒ EncCBOR (MIRCert c) Source # | |
NFData (MIRCert c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert | |
Eq (MIRCert c) Source # | |
Ord (MIRCert c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert | |
NoThunks (MIRCert c) Source # | |
type Rep (MIRCert c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert type Rep (MIRCert c) = D1 ('MetaData "MIRCert" "Cardano.Ledger.Shelley.TxCert" "cardano-ledger-shelley-1.15.0.0-inplace" 'False) (C1 ('MetaCons "MIRCert" 'PrefixI 'True) (S1 ('MetaSel ('Just "mirPot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MIRPot) :*: S1 ('MetaSel ('Just "mirRewards") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MIRTarget c)))) |
Instances
ToJSON MIRPot Source # | |
Bounded MIRPot Source # | |
Enum MIRPot Source # | |
Defined in Cardano.Ledger.Shelley.TxCert succ ∷ MIRPot → MIRPot Source # pred ∷ MIRPot → MIRPot Source # toEnum ∷ Int → MIRPot Source # fromEnum ∷ MIRPot → Int Source # enumFrom ∷ MIRPot → [MIRPot] Source # enumFromThen ∷ MIRPot → MIRPot → [MIRPot] Source # enumFromTo ∷ MIRPot → MIRPot → [MIRPot] Source # enumFromThenTo ∷ MIRPot → MIRPot → MIRPot → [MIRPot] Source # | |
Generic MIRPot Source # | |
Show MIRPot Source # | |
DecCBOR MIRPot Source # | |
EncCBOR MIRPot Source # | |
NFData MIRPot Source # | |
Defined in Cardano.Ledger.Shelley.TxCert | |
Eq MIRPot Source # | |
Ord MIRPot Source # | |
Defined in Cardano.Ledger.Shelley.TxCert | |
NoThunks MIRPot Source # | |
type Rep MIRPot Source # | |
MIRTarget specifies if funds from either the reserves or the treasury are to be handed out to a collection of reward accounts or instead transfered to the opposite pot.
Instances
Crypto c ⇒ ToJSON (MIRTarget c) Source # | |
Generic (MIRTarget c) Source # | |
Show (MIRTarget c) Source # | |
Crypto c ⇒ DecCBOR (MIRTarget c) Source # | |
Crypto c ⇒ EncCBOR (MIRTarget c) Source # | |
NFData (MIRTarget c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert | |
Eq (MIRTarget c) Source # | |
Ord (MIRTarget c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert | |
NoThunks (MIRTarget c) Source # | |
type Rep (MIRTarget c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert type Rep (MIRTarget c) = D1 ('MetaData "MIRTarget" "Cardano.Ledger.Shelley.TxCert" "cardano-ledger-shelley-1.15.0.0-inplace" 'False) (C1 ('MetaCons "StakeAddressesMIR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking c) DeltaCoin))) :+: C1 ('MetaCons "SendToOppositePotMIR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) |
pattern GenesisDelegTxCert ∷ (ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ KeyHash 'Genesis (EraCrypto era) → KeyHash 'GenesisDelegate (EraCrypto era) → VRFVerKeyHash 'GenDelegVRF (EraCrypto era) → TxCert era Source #
pattern RegTxCert ∷ ShelleyEraTxCert era ⇒ StakeCredential (EraCrypto era) → TxCert era Source #
pattern UnRegTxCert ∷ ShelleyEraTxCert era ⇒ StakeCredential (EraCrypto era) → TxCert era Source #
pattern DelegStakeTxCert ∷ ShelleyEraTxCert era ⇒ StakeCredential (EraCrypto era) → KeyHash 'StakePool (EraCrypto era) → TxCert era Source #
hashScript ∷ EraScript era ⇒ Script era → ScriptHash (EraCrypto era) Source #
Compute ScriptHash
of a Script
for a particular era.
hashScriptTxWitsL ∷ EraTxWits era ⇒ Lens (TxWits era) (TxWits era) (Map (ScriptHash (EraCrypto era)) (Script era)) [Script era] Source #
This is a helper lens that will hash the scripts when adding as witnesses.
isAdaOnlyTxOutF ∷ EraTxOut era ⇒ SimpleGetter (TxOut era) Bool Source #
This is a getter that implements an efficient way to check whether TxOut
contains ADA only.
compactCoinTxOutL ∷ (HasCallStack, EraTxOut era) ⇒ Lens' (TxOut era) (CompactForm Coin) Source #
coinTxOutL ∷ (HasCallStack, EraTxOut era) ⇒ Lens' (TxOut era) Coin Source #
bootAddrTxOutF ∷ EraTxOut era ⇒ SimpleGetter (TxOut era) (Maybe (BootstrapAddress (EraCrypto era))) Source #
type family TxUpgradeError era Source #
Instances
type TxUpgradeError (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Tx.Internal |
type family Tx era = (r ∷ Type) | r → era Source #
Instances
type Tx (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Tx.Internal |
class (EraTxBody era, EraTxWits era, EraTxAuxData era, EraPParams era, NoThunks (Tx era), DecCBOR (Annotator (Tx era)), EncCBOR (Tx era), ToCBOR (Tx era), Show (Tx era), Eq (Tx era), EqRaw (Tx era)) ⇒ EraTx era where Source #
A transaction.
type Tx era = (r ∷ Type) | r → era Source #
type TxUpgradeError era Source #
type TxUpgradeError era = Void
mkBasicTx ∷ TxBody era → Tx era Source #
bodyTxL ∷ Lens' (Tx era) (TxBody era) Source #
witsTxL ∷ Lens' (Tx era) (TxWits era) Source #
auxDataTxL ∷ Lens' (Tx era) (StrictMaybe (TxAuxData era)) Source #
sizeTxF ∷ SimpleGetter (Tx era) Integer Source #
For fee calculation and estimations of impact on block space
wireSizeTxF ∷ SimpleGetter (Tx era) Word32 Source #
For end use by eg. diffusion layer in transaction submission protocol
validateNativeScript ∷ Tx era → NativeScript era → Bool Source #
Using information from the transaction validate the supplied native script.
Minimum fee calculation excluding witnesses
upgradeTx ∷ Tx (PreviousEra era) → Either (TxUpgradeError era) (Tx era) Source #
Instances
Crypto c ⇒ EraTx (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Tx.Internal type Tx (ShelleyEra c) = (r ∷ Type) Source # type TxUpgradeError (ShelleyEra c) Source # mkBasicTx ∷ TxBody (ShelleyEra c) → Tx (ShelleyEra c) Source # bodyTxL ∷ Lens' (Tx (ShelleyEra c)) (TxBody (ShelleyEra c)) Source # witsTxL ∷ Lens' (Tx (ShelleyEra c)) (TxWits (ShelleyEra c)) Source # auxDataTxL ∷ Lens' (Tx (ShelleyEra c)) (StrictMaybe (TxAuxData (ShelleyEra c))) Source # sizeTxF ∷ SimpleGetter (Tx (ShelleyEra c)) Integer Source # wireSizeTxF ∷ SimpleGetter (Tx (ShelleyEra c)) Word32 Source # validateNativeScript ∷ Tx (ShelleyEra c) → NativeScript (ShelleyEra c) → Bool Source # getMinFeeTx ∷ PParams (ShelleyEra c) → Tx (ShelleyEra c) → Int → Coin Source # upgradeTx ∷ Tx (PreviousEra (ShelleyEra c)) → Either (TxUpgradeError (ShelleyEra c)) (Tx (ShelleyEra c)) Source # |
type family TxBodyUpgradeError era Source #
Instances
type TxBodyUpgradeError (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxBody |
type family TxBody era = (r ∷ Type) | r → era Source #
The body of a transaction.
Instances
type TxBody (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxBody |
class (EraTxOut era, EraTxCert era, EraPParams era, HashAnnotated (TxBody era) EraIndependentTxBody (EraCrypto era), DecCBOR (Annotator (TxBody era)), EncCBOR (TxBody era), ToCBOR (TxBody era), NoThunks (TxBody era), NFData (TxBody era), Show (TxBody era), Eq (TxBody era), EqRaw (TxBody era)) ⇒ EraTxBody era where Source #
mkBasicTxBody, inputsTxBodyL, outputsTxBodyL, feeTxBodyL, withdrawalsTxBodyL, auxDataHashTxBodyL, spendableInputsTxBodyF, allInputsTxBodyF, certsTxBodyL, upgradeTxBody
type TxBody era = (r ∷ Type) | r → era Source #
The body of a transaction.
type TxBodyUpgradeError era Source #
type TxBodyUpgradeError era = Void
mkBasicTxBody ∷ TxBody era Source #
inputsTxBodyL ∷ Lens' (TxBody era) (Set (TxIn (EraCrypto era))) Source #
outputsTxBodyL ∷ Lens' (TxBody era) (StrictSeq (TxOut era)) Source #
feeTxBodyL ∷ Lens' (TxBody era) Coin Source #
withdrawalsTxBodyL ∷ Lens' (TxBody era) (Withdrawals (EraCrypto era)) Source #
auxDataHashTxBodyL ∷ Lens' (TxBody era) (StrictMaybe (AuxiliaryDataHash (EraCrypto era))) Source #
spendableInputsTxBodyF ∷ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era))) Source #
This getter will produce all inputs from the UTxO map that this transaction might spend, which ones will depend on the validity of the transaction itself. Starting in Alonzo this will include collateral inputs.
allInputsTxBodyF ∷ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era))) Source #
This getter will produce all inputs from the UTxO map that this transaction is referencing, even if some of them cannot be spent by the transaction. For example starting with Babbage era it will also include reference inputs.
certsTxBodyL ∷ Lens' (TxBody era) (StrictSeq (TxCert era)) Source #
getTotalDepositsTxBody Source #
∷ PParams era | |
→ (KeyHash 'StakePool (EraCrypto era) → Bool) | Check whether stake pool is registered or not |
→ TxBody era | |
→ Coin |
Compute the total deposits from the certificates in a TxBody.
This is the contribution of a TxBody towards the consumed amount by the transaction
getTotalRefundsTxBody Source #
∷ PParams era | |
→ (Credential 'Staking (EraCrypto era) → Maybe Coin) | Lookup current deposit for Staking credential if one is registered |
→ (Credential 'DRepRole (EraCrypto era) → Maybe Coin) | Lookup current deposit for DRep credential if one is registered |
→ TxBody era | |
→ Coin |
Compute the total refunds from the Certs of a TxBody.
This is the contribution of a TxBody towards produced amount by the transaction
getGenesisKeyHashCountTxBody ∷ TxBody era → Int Source #
This function is not used in the ledger rules. It is only used by the downstream tooling to figure out how many witnesses should be supplied for Genesis keys.
upgradeTxBody ∷ TxBody (PreviousEra era) → Either (TxBodyUpgradeError era) (TxBody era) Source #
Upgrade the transaction body from the previous era.
This can fail where elements of the transaction body are deprecated.
Compare this to translateEraThroughCBOR
:
- upgradeTxBody
will use the Haskell representation, but will not
preserve the serialised form. However, it will be suitable for iterated
translation through eras.
- translateEraThroughCBOR
will preserve the binary representation, but is
not guaranteed to work through multiple eras - that is, the serialised
representation from era n is guaranteed valid in era n + 1, but not
necessarily in era n + 2.
Instances
type family TxOut era = (r ∷ Type) | r → era Source #
The output of a UTxO for a particular era
Instances
type TxOut (ShelleyEra crypto) Source # | |
Defined in Cardano.Ledger.Shelley.TxOut |
class (Val (Value era), ToJSON (TxOut era), DecCBOR (Value era), DecCBOR (CompactForm (Value era)), EncCBOR (Value era), ToCBOR (TxOut era), EncCBOR (TxOut era), DecCBOR (TxOut era), DecShareCBOR (TxOut era), Share (TxOut era) ~ Interns (Credential 'Staking (EraCrypto era)), NoThunks (TxOut era), NFData (TxOut era), Show (TxOut era), Eq (TxOut era), EraPParams era) ⇒ EraTxOut era where Source #
Abstract interface into specific fields of a TxOut
mkBasicTxOut, upgradeTxOut, valueEitherTxOutL, addrEitherTxOutL, (getMinCoinSizedTxOut | getMinCoinTxOut)
mkBasicTxOut ∷ Addr (EraCrypto era) → Value era → TxOut era Source #
upgradeTxOut ∷ TxOut (PreviousEra era) → TxOut era Source #
Every era, except Shelley, must be able to upgrade a TxOut
from a previous era.
valueTxOutL ∷ Lens' (TxOut era) (Value era) Source #
compactValueTxOutL ∷ Lens' (TxOut era) (CompactForm (Value era)) Source #
valueEitherTxOutL ∷ Lens' (TxOut era) (Either (Value era) (CompactForm (Value era))) Source #
Lens for getting and setting in TxOut either an address or its compact version by doing the least amount of work.
addrTxOutL ∷ Lens' (TxOut era) (Addr (EraCrypto era)) Source #
compactAddrTxOutL ∷ Lens' (TxOut era) (CompactAddr (EraCrypto era)) Source #
addrEitherTxOutL ∷ Lens' (TxOut era) (Either (Addr (EraCrypto era)) (CompactAddr (EraCrypto era))) Source #
Lens for getting and setting in TxOut either an address or its compact version by doing the least amount of work.
The utility of this function comes from the fact that TxOut usually stores
the address in either one of two forms: compacted or unpacked. In order to
avoid extroneous conversions in getTxOutAddr
and getTxOutCompactAddr
we
can define just this functionality. Also sometimes it is crucial to know at
the callsite which form of address we have readily available without any
conversions (eg. searching millions of TxOuts for a particular address)
getMinCoinSizedTxOut ∷ PParams era → Sized (TxOut era) → Coin Source #
Produce the minimum lovelace that a given transaction output must
contain. Information about the size of the TxOut is required in some eras.
Use getMinCoinTxOut
if you don't have the size readily available to you.
getMinCoinTxOut ∷ PParams era → TxOut era → Coin Source #
Same as getMinCoinSizedTxOut
, except information about the size of
TxOut will be computed by serializing the TxOut. If the size turns out to
be not needed, then serialization will have no overhead, since it is
computed lazily.
Instances
type family Value era Source #
A value is something which quantifies a transaction output.
Instances
type Value (ShelleyEra _c) Source # | |
Defined in Cardano.Ledger.Shelley.Era |
type family TxAuxData era = (r ∷ Type) | r → era Source #
Instances
type TxAuxData (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxAuxData |
class (Era era, Eq (TxAuxData era), EqRaw (TxAuxData era), Show (TxAuxData era), NoThunks (TxAuxData era), ToCBOR (TxAuxData era), EncCBOR (TxAuxData era), DecCBOR (Annotator (TxAuxData era)), HashAnnotated (TxAuxData era) EraIndependentTxAuxData (EraCrypto era)) ⇒ EraTxAuxData era where Source #
TxAuxData which may be attached to a transaction
mkBasicTxAuxData ∷ TxAuxData era Source #
metadataTxAuxDataL ∷ Lens' (TxAuxData era) (Map Word64 Metadatum) Source #
upgradeTxAuxData ∷ TxAuxData (PreviousEra era) → TxAuxData era Source #
Every era, except Shelley, must be able to upgrade a TxAuxData
from a previous
era.
Warning - Important to note that any memoized binary representation will not be
preserved. If you need to retain underlying bytes you can use translateEraThroughCBOR
hashTxAuxData ∷ TxAuxData era → AuxiliaryDataHash (EraCrypto era) Source #
Instances
Crypto c ⇒ EraTxAuxData (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxAuxData type TxAuxData (ShelleyEra c) = (r ∷ Type) Source # mkBasicTxAuxData ∷ TxAuxData (ShelleyEra c) Source # metadataTxAuxDataL ∷ Lens' (TxAuxData (ShelleyEra c)) (Map Word64 Metadatum) Source # upgradeTxAuxData ∷ TxAuxData (PreviousEra (ShelleyEra c)) → TxAuxData (ShelleyEra c) Source # hashTxAuxData ∷ TxAuxData (ShelleyEra c) → AuxiliaryDataHash (EraCrypto (ShelleyEra c)) Source # validateTxAuxData ∷ ProtVer → TxAuxData (ShelleyEra c) → Bool Source # |
type family TxWits era = (r ∷ Type) | r → era Source #
Instances
type TxWits (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxWits |
class (EraScript era, Eq (TxWits era), EqRaw (TxWits era), Show (TxWits era), Monoid (TxWits era), NoThunks (TxWits era), ToCBOR (TxWits era), EncCBOR (TxWits era), DecCBOR (Annotator (TxWits era))) ⇒ EraTxWits era where Source #
A collection of witnesses in a Tx
mkBasicTxWits ∷ TxWits era Source #
addrTxWitsL ∷ Lens' (TxWits era) (Set (WitVKey 'Witness (EraCrypto era))) Source #
bootAddrTxWitsL ∷ Lens' (TxWits era) (Set (BootstrapWitness (EraCrypto era))) Source #
scriptTxWitsL ∷ Lens' (TxWits era) (Map (ScriptHash (EraCrypto era)) (Script era)) Source #
upgradeTxWits ∷ TxWits (PreviousEra era) → TxWits era Source #
Instances
Crypto c ⇒ EraTxWits (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxWits type TxWits (ShelleyEra c) = (r ∷ Type) Source # mkBasicTxWits ∷ TxWits (ShelleyEra c) Source # addrTxWitsL ∷ Lens' (TxWits (ShelleyEra c)) (Set (WitVKey 'Witness (EraCrypto (ShelleyEra c)))) Source # bootAddrTxWitsL ∷ Lens' (TxWits (ShelleyEra c)) (Set (BootstrapWitness (EraCrypto (ShelleyEra c)))) Source # scriptTxWitsL ∷ Lens' (TxWits (ShelleyEra c)) (Map (ScriptHash (EraCrypto (ShelleyEra c))) (Script (ShelleyEra c))) Source # upgradeTxWits ∷ TxWits (PreviousEra (ShelleyEra c)) → TxWits (ShelleyEra c) Source # |
type family NativeScript era = (r ∷ Type) | r → era Source #
Instances
type NativeScript (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Scripts |
type family Script era = (r ∷ Type) | r → era Source #
Scripts which may lock transaction outputs in this era
Instances
type Script (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Scripts |
class (Era era, Show (Script era), Eq (Script era), EqRaw (Script era), ToCBOR (Script era), EncCBOR (Script era), DecCBOR (Annotator (Script era)), NoThunks (Script era), SafeToHash (Script era), Eq (NativeScript era), Show (NativeScript era), NFData (NativeScript era), NoThunks (NativeScript era), EncCBOR (NativeScript era), DecCBOR (Annotator (NativeScript era))) ⇒ EraScript era where Source #
Typeclass for script data types. Allows for script validation and hashing.
You must understand the role of SafeToHash and scriptPrefixTag to make new
instances. scriptPrefixTag
is a magic number representing the tag of the
script language. For each new script language defined, a new tag is chosen
and the tag is included in the script hash for a script. The safeToHash
constraint ensures that Scripts are never reserialised.
type Script era = (r ∷ Type) | r → era Source #
Scripts which may lock transaction outputs in this era
type NativeScript era = (r ∷ Type) | r → era Source #
upgradeScript ∷ Script (PreviousEra era) → Script era Source #
Every era, except Shelley, must be able to upgrade a Script
from a previous era.
Warning - Important to note that any memoized binary representation will not be
preserved, you need to retain underlying bytes you can use translateEraThroughCBOR
scriptPrefixTag ∷ Script era → ByteString Source #
getNativeScript ∷ Script era → Maybe (NativeScript era) Source #
fromNativeScript ∷ NativeScript era → Script era Source #
Instances
Crypto c ⇒ EraScript (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Scripts type Script (ShelleyEra c) = (r ∷ Type) Source # type NativeScript (ShelleyEra c) = (r ∷ Type) Source # upgradeScript ∷ Script (PreviousEra (ShelleyEra c)) → Script (ShelleyEra c) Source # scriptPrefixTag ∷ Script (ShelleyEra c) → ByteString Source # getNativeScript ∷ Script (ShelleyEra c) → Maybe (NativeScript (ShelleyEra c)) Source # fromNativeScript ∷ NativeScript (ShelleyEra c) → Script (ShelleyEra c) Source # |
type family TxSeq era = (r ∷ Type) | r → era Source #
Instances
type TxSeq (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.BlockChain |
class (EraTx era, Eq (TxSeq era), Show (TxSeq era), EncCBORGroup (TxSeq era), DecCBOR (Annotator (TxSeq era))) ⇒ EraSegWits era where Source #
Indicates that an era supports segregated witnessing.
This class embodies an isomorphism between 'TxSeq era' and 'StrictSeq
(Tx era)', witnessed by fromTxSeq
and toTxSeq
.
fromTxSeq ∷ TxSeq era → StrictSeq (Tx era) Source #
toTxSeq ∷ StrictSeq (Tx era) → TxSeq era Source #
hashTxSeq ∷ TxSeq era → Hash (HASH (EraCrypto era)) EraIndependentBlockBody Source #
Get the block body hash from the TxSeq. Note that this is not a regular "hash the stored bytes" function since the block body hash forms a small Merkle tree.
numSegComponents ∷ Word64 Source #
The number of segregated components
Instances
Crypto c ⇒ EraSegWits (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.BlockChain type TxSeq (ShelleyEra c) = (r ∷ Type) Source # fromTxSeq ∷ TxSeq (ShelleyEra c) → StrictSeq (Tx (ShelleyEra c)) Source # toTxSeq ∷ StrictSeq (Tx (ShelleyEra c)) → TxSeq (ShelleyEra c) Source # hashTxSeq ∷ TxSeq (ShelleyEra c) → Hash (HASH (EraCrypto (ShelleyEra c))) EraIndependentBlockBody Source # |
isUnRegStakeTxCert ∷ EraTxCert era ⇒ TxCert era → Bool Source #
Check if supplied TxCert is a stake un-registering certificate
isRegStakeTxCert ∷ EraTxCert era ⇒ TxCert era → Bool Source #
Check if supplied TxCert is a stake registering certificate
pattern RegPoolTxCert ∷ EraTxCert era ⇒ PoolParams (EraCrypto era) → TxCert era Source #
pattern RetirePoolTxCert ∷ EraTxCert era ⇒ KeyHash 'StakePool (EraCrypto era) → EpochNo → TxCert era Source #
type family TxCertUpgradeError era Source #
Instances
type TxCertUpgradeError (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert |
type family TxCert era = (r ∷ Type) | r → era Source #
Instances
type TxCert (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.TxCert |
class (Era era, ToJSON (TxCert era), DecCBOR (TxCert era), EncCBOR (TxCert era), ToCBOR (TxCert era), FromCBOR (TxCert era), NoThunks (TxCert era), NFData (TxCert era), Show (TxCert era), Ord (TxCert era), Eq (TxCert era)) ⇒ EraTxCert era where Source #
type TxCert era = (r ∷ Type) | r → era Source #
type TxCertUpgradeError era Source #
type TxCertUpgradeError era = Void
upgradeTxCert ∷ TxCert (PreviousEra era) → Either (TxCertUpgradeError era) (TxCert era) Source #
Every era, except Shelley, must be able to upgrade a TxCert
from a previous
era. However, not all certificates can be upgraded, because some eras lose some of
the certificates, thus return type is an Either
. Eg. from Babbage to Conway: MIR
and Genesis certificates were removed.
getVKeyWitnessTxCert ∷ TxCert era → Maybe (KeyHash 'Witness (EraCrypto era)) Source #
Return a witness key whenever a certificate requires one
getScriptWitnessTxCert ∷ TxCert era → Maybe (ScriptHash (EraCrypto era)) Source #
Return a ScriptHash for certificate types that require a witness
mkRegPoolTxCert ∷ PoolParams (EraCrypto era) → TxCert era Source #
getRegPoolTxCert ∷ TxCert era → Maybe (PoolParams (EraCrypto era)) Source #
mkRetirePoolTxCert ∷ KeyHash 'StakePool (EraCrypto era) → EpochNo → TxCert era Source #
getRetirePoolTxCert ∷ TxCert era → Maybe (KeyHash 'StakePool (EraCrypto era), EpochNo) Source #
lookupRegStakeTxCert ∷ TxCert era → Maybe (Credential 'Staking (EraCrypto era)) Source #
Extract staking credential from any certificate that can register such credential
lookupUnRegStakeTxCert ∷ TxCert era → Maybe (Credential 'Staking (EraCrypto era)) Source #
Extract staking credential from any certificate that can unregister such credential
getTotalDepositsTxCerts Source #
∷ Foldable f | |
⇒ PParams era | |
→ (KeyHash 'StakePool (EraCrypto era) → Bool) | Check whether stake pool is registered or not |
→ f (TxCert era) | |
→ Coin |
Compute the total deposits from a list of certificates.
getTotalRefundsTxCerts Source #
∷ Foldable f | |
⇒ PParams era | |
→ (Credential 'Staking (EraCrypto era) → Maybe Coin) | Lookup current deposit for Staking credential if one is registered |
→ (Credential 'DRepRole (EraCrypto era) → Maybe Coin) | Lookup current deposit for DRep credential if one is registered |
→ f (TxCert era) | |
→ Coin |
Compute the total refunds from a list of certificates.
Instances
RegPool !(PoolParams c) | A stake pool registration certificate. |
RetirePool !(KeyHash 'StakePool c) !EpochNo | A stake pool retirement certificate. |
Instances
Crypto c ⇒ ToJSON (PoolCert c) | |
Generic (PoolCert c) | |
Show (PoolCert c) | |
Crypto c ⇒ EncCBOR (PoolCert c) | |
NFData (PoolCert c) | |
Defined in Cardano.Ledger.Core.TxCert | |
Eq (PoolCert c) | |
Ord (PoolCert c) | |
Defined in Cardano.Ledger.Core.TxCert | |
NoThunks (PoolCert c) | |
type Rep (PoolCert c) | |
Defined in Cardano.Ledger.Core.TxCert type Rep (PoolCert c) = D1 ('MetaData "PoolCert" "Cardano.Ledger.Core.TxCert" "cardano-ledger-core-1.16.0.0-inplace" 'False) (C1 ('MetaCons "RegPool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PoolParams c))) :+: C1 ('MetaCons "RetirePool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool c)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 EpochNo))) |
makePParamMap ∷ [PParam era] → Map Word (PParam era) Source #
Turn a list into a Map, this assures we have no duplicates.
downgradePParamsUpdate ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ DowngradePParams StrictMaybe era → PParamsUpdate era → PParamsUpdate (PreviousEra era) Source #
upgradePParamsUpdate ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ UpgradePParams StrictMaybe era → PParamsUpdate (PreviousEra era) → PParamsUpdate era Source #
downgradePParams ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ DowngradePParams Identity era → PParams era → PParams (PreviousEra era) Source #
upgradePParams ∷ (EraPParams era, EraPParams (PreviousEra era)) ⇒ UpgradePParams Identity era → PParams (PreviousEra era) → PParams era Source #
mapPParamsUpdate ∷ (PParamsHKD StrictMaybe era1 → PParamsHKD StrictMaybe era2) → PParamsUpdate era1 → PParamsUpdate era2 Source #
mapPParams ∷ (PParamsHKD Identity era1 → PParamsHKD Identity era2) → PParams era1 → PParams era2 Source #
ppuMinPoolCostL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin) Source #
Minimum Stake Pool Cost
ppuMinUTxOValueL ∷ (EraPParams era, ProtVerAtMost era 4) ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin) Source #
Minimum UTxO value
ppuExtraEntropyL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParamsUpdate era) (StrictMaybe Nonce) Source #
Extra entropy
ppuDL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParamsUpdate era) (StrictMaybe UnitInterval) Source #
Decentralization parameter
ppuTauL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe UnitInterval) Source #
Treasury expansion
ppuRhoL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe UnitInterval) Source #
Monetary expansion
ppuA0L ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe NonNegativeInterval) Source #
Pool influence
ppuNOptL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Natural) Source #
Desired number of pools
ppuEMaxL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe EpochInterval) Source #
epoch bound on pool retirement
ppuPoolDepositL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin) Source #
The amount of a pool registration deposit
ppuKeyDepositL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin) Source #
The amount of a key registration deposit
ppuMaxBHSizeL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Word16) Source #
Maximal block header size
ppuMaxTxSizeL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Word32) Source #
Maximal transaction size
ppuMaxBBSizeL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Word32) Source #
Maximal block body size
ppuMinFeeBL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin) Source #
The constant factor for the minimum fee calculation
ppuMinFeeAL ∷ EraPParams era ⇒ Lens' (PParamsUpdate era) (StrictMaybe Coin) Source #
The linear factor for the minimum fee calculation
ppMinPoolCostL ∷ EraPParams era ⇒ Lens' (PParams era) Coin Source #
Minimum Stake Pool Cost
ppMinUTxOValueL ∷ (EraPParams era, ProtVerAtMost era 4) ⇒ Lens' (PParams era) Coin Source #
Minimum UTxO value
ppExtraEntropyL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParams era) Nonce Source #
Extra entropy
ppDL ∷ (EraPParams era, ProtVerAtMost era 6) ⇒ Lens' (PParams era) UnitInterval Source #
Decentralization parameter
ppTauL ∷ EraPParams era ⇒ Lens' (PParams era) UnitInterval Source #
Treasury expansion
ppRhoL ∷ EraPParams era ⇒ Lens' (PParams era) UnitInterval Source #
Monetary expansion
ppA0L ∷ EraPParams era ⇒ Lens' (PParams era) NonNegativeInterval Source #
Pool influence
ppEMaxL ∷ EraPParams era ⇒ Lens' (PParams era) EpochInterval Source #
epoch bound on pool retirement
ppPoolDepositL ∷ EraPParams era ⇒ Lens' (PParams era) Coin Source #
The amount of a pool registration deposit
ppKeyDepositL ∷ EraPParams era ⇒ Lens' (PParams era) Coin Source #
The amount of a key registration deposit
ppMaxBHSizeL ∷ EraPParams era ⇒ Lens' (PParams era) Word16 Source #
Maximal block header size
ppMaxTxSizeL ∷ EraPParams era ⇒ Lens' (PParams era) Word32 Source #
Maximal transaction size
ppMaxBBSizeL ∷ EraPParams era ⇒ Lens' (PParams era) Word32 Source #
Maximal block body size
ppMinFeeBL ∷ EraPParams era ⇒ Lens' (PParams era) Coin Source #
The constant factor for the minimum fee calculation
ppMinFeeAL ∷ EraPParams era ⇒ Lens' (PParams era) Coin Source #
The linear factor for the minimum fee calculation
ppuLens ∷ Lens' (PParamsUpdate era) (PParamsHKD StrictMaybe era) Source #
emptyPParamsUpdate ∷ EraPParams era ⇒ PParamsUpdate era Source #
emptyPParams ∷ EraPParams era ⇒ PParams era Source #
genericApplyPPUpdates ∷ (Generic (PParamsHKD Identity era), Generic (PParamsHKD StrictMaybe era), Updatable (Rep (PParamsHKD Identity era) a) (Rep (PParamsHKD StrictMaybe era) u)) ⇒ PParams era → PParamsUpdate era → PParams era Source #
Protocol parameters
PParams (PParamsHKD Identity era) |
Instances
newtype PParamsUpdate era Source #
The type of updates to Protocol parameters
Instances
type family DowngradePParams (f ∷ Type → Type) era Source #
Instances
type DowngradePParams f (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.PParams |
type family UpgradePParams (f ∷ Type → Type) era Source #
Instances
type UpgradePParams f (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.PParams |
type family PParamsHKD (f ∷ Type → Type) era = (r ∷ Type) | r → era Source #
Protocol parameters where the fields are represented with a HKD
Instances
type PParamsHKD f (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.PParams |
class (Era era, Eq (PParamsHKD Identity era), Ord (PParamsHKD Identity era), Show (PParamsHKD Identity era), NFData (PParamsHKD Identity era), EncCBOR (PParamsHKD Identity era), DecCBOR (PParamsHKD Identity era), ToCBOR (PParamsHKD Identity era), FromCBOR (PParamsHKD Identity era), NoThunks (PParamsHKD Identity era), ToJSON (PParamsHKD Identity era), FromJSON (PParamsHKD Identity era), Eq (PParamsHKD StrictMaybe era), Ord (PParamsHKD StrictMaybe era), Show (PParamsHKD StrictMaybe era), NFData (PParamsHKD StrictMaybe era), EncCBOR (PParamsHKD StrictMaybe era), DecCBOR (PParamsHKD StrictMaybe era), ToCBOR (PParamsHKD StrictMaybe era), FromCBOR (PParamsHKD StrictMaybe era), NoThunks (PParamsHKD StrictMaybe era), ToJSON (PParamsHKD StrictMaybe era)) ⇒ EraPParams era where Source #
emptyPParamsIdentity, emptyPParamsStrictMaybe, upgradePParamsHKD, downgradePParamsHKD, hkdMinFeeAL, hkdMinFeeBL, hkdMaxBBSizeL, hkdMaxTxSizeL, hkdMaxBHSizeL, hkdKeyDepositL, hkdPoolDepositL, hkdEMaxL, hkdNOptL, hkdA0L, hkdRhoL, hkdTauL, hkdDL, hkdExtraEntropyL, hkdProtocolVersionL, hkdMinUTxOValueL, hkdMinPoolCostL
type PParamsHKD (f ∷ Type → Type) era = (r ∷ Type) | r → era Source #
Protocol parameters where the fields are represented with a HKD
type UpgradePParams (f ∷ Type → Type) era Source #
type DowngradePParams (f ∷ Type → Type) era Source #
applyPPUpdates ∷ PParams era → PParamsUpdate era → PParams era Source #
Applies a protocol parameters update
ppDG ∷ SimpleGetter (PParams era) UnitInterval Source #
Decentralization parameter getter
ppProtocolVersionL ∷ Lens' (PParams era) ProtVer Source #
ppuProtocolVersionL ∷ Lens' (PParamsUpdate era) (StrictMaybe ProtVer) Source #
PParamsUpdate Protocol version
Instances
data PParam era where Source #
Pair the tag, and exisitenially hide the type of the lens for the field with that Lens'
PParam ∷ ∀ t era. ToPlutusData t ⇒ Word → Lens' (PParamsUpdate era) (StrictMaybe t) → PParam era |
data RewardType Source #
The staking rewards in Cardano are all either:
- member rewards - rewards given to a registered stake credential which has delegated to a stake pool, or
- leader rewards - rewards given to a registered stake pool (in particular, given to the stake credential in the stake pool registration certificate).
See Figure 47, "Functions used in the Reward Splitting", of the formal specification for more details.
Instances
The Reward
type captures:
- if the reward is a member or leader reward
- the stake pool ID associated with the reward
- the number of Lovelace in the reward
Reward | |
|
Instances
Crypto c ⇒ ToJSON (Reward c) | |
Generic (Reward c) | |
Show (Reward c) | |
Crypto c ⇒ DecCBOR (Reward c) | |
Crypto c ⇒ EncCBOR (Reward c) | |
NFData (Reward c) | |
Defined in Cardano.Ledger.Rewards | |
Eq (Reward c) | |
Ord (Reward c) | Note that this Ord instance is chosen to align precisely
with the Allegra reward aggregation, as given by the
function |
NoThunks (Reward c) | |
type Rep (Reward c) | |
Defined in Cardano.Ledger.Rewards type Rep (Reward c) = D1 ('MetaData "Reward" "Cardano.Ledger.Rewards" "cardano-ledger-core-1.16.0.0-inplace" 'False) (C1 ('MetaCons "Reward" 'PrefixI 'True) (S1 ('MetaSel ('Just "rewardType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardType) :*: (S1 ('MetaSel ('Just "rewardPool") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool c)) :*: S1 ('MetaSel ('Just "rewardAmount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))) |
data EraIndependentTxBody Source #
Instances
(Era era, c ~ EraCrypto era) ⇒ HashAnnotated (ShelleyTxBody era) EraIndependentTxBody c Source # | |
Defined in Cardano.Ledger.Shelley.TxBody |
data EraIndependentTxAuxData Source #
Instances
c ~ EraCrypto era ⇒ HashAnnotated (ShelleyTxAuxData era) EraIndependentTxAuxData c Source # | |
Defined in Cardano.Ledger.Shelley.TxAuxData |
data EraIndependentScript Source #
data EraIndependentData Source #
type DataHash c = SafeHash c EraIndependentData Source #
newtype ScriptHash c Source #
Instances
translateEraThroughCBOR Source #
∷ (Era era, ToCBOR (ti (PreviousEra era)), DecCBOR (Annotator (to era))) | |
⇒ Text | Label for error reporting |
→ ti (PreviousEra era) | |
→ Except DecoderError (to era) |
Translate a type through its binary representation from previous era to the current one.
translateEraMaybe ∷ (TranslateEra era f, TranslationError era f ~ ()) ⇒ TranslationContext era → f (PreviousEra era) → Maybe (f era) Source #
Variant of translateEra
for when TranslationError
is ()
, converting
the result to a Maybe
.
translateEra' ∷ (TranslateEra era f, TranslationError era f ~ Void) ⇒ TranslationContext era → f (PreviousEra era) → f era Source #
Variant of translateEra
for when TranslationError
is Void
and the
translation thus cannot fail.
type family TranslationContext era Source #
Per-era context used for TranslateEra
.
This context will be passed to the translation instances of all types of that particular era. In practice, most instances won't need the context, but this approach makes the translation composable (as opposed to having a separate context per type).
Instances
type TranslationContext (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Translation |
type family TranslationError era (f ∷ Type → TYPE LiftedRep) Source #
Most translations should be infallible (default instance), but we leave the door open for partial translations.
For a partial translation, override the default type to be ()
or a
concrete error type.
class (Era era, Era (PreviousEra era)) ⇒ TranslateEra era (f ∷ Type → TYPE LiftedRep) where Source #
Translation of types between eras, e.g., from Shelley to Allegra.
When era
is just a phantom type parameter, an empty standalone deriving can be used:
newtype Foo era = Foo Int instance TranslateEra (Allegra c) Foo
Note that one could use DerivingAnyClass
(deriving (TranslateEra (Allegra
c))
), but this would introduce an undesired coupling between the
era-parametric type and (a) particular era(s). The intention is to have a
module with orphan instances per era.
In most cases, the era
parameter won't be phantom, and a manual instance
will have to be written:
newtype Bar era = Bar (TxBody era) instance CC.Crypto c => TranslateEra (Allegra c) Bar where translateEra ctxt = Bar <$> translateEra ctxt -- With the following instance being in scope: instance CC.Crypto c => TranslatEra (Allegra c) TxBody
Note: we use PreviousEra
instead of NextEra
as an era definitely knows
its predecessor, but not necessarily its successor. Moreover, one could argue
that it makes more sense to define the translation from era A to era B where
era B is defined, than where era A is defined.
Nothing
type TranslationError era (f ∷ Type → TYPE LiftedRep) Source #
Most translations should be infallible (default instance), but we leave the door open for partial translations.
For a partial translation, override the default type to be ()
or a
concrete error type.
type TranslationError era (f ∷ Type → TYPE LiftedRep) = Void
translateEra ∷ TranslationContext era → f (PreviousEra era) → Except (TranslationError era f) (f era) Source #
Translate a type f
parameterised by the era from an era to the era
after it.
The translation is a given the translation context of era
.
A default instance is provided for when the two types are Coercible
.
eraDecoder ∷ ∀ era t s. Era era ⇒ Decoder s t → Decoder s t Source #
Convert a versioned Decoder
to plain a Decoder
using the lowest protocol
version for the supplied era
This action should not be used for decoders that require access to original bytes, use
toPlainDecoder
instead.
fromEraShareCBOR ∷ (Era era, DecShareCBOR t) ⇒ Decoder s t Source #
Convert a type that implements DecShareCBOR
to plain Decoder
using the lowest
protocol version for the supplied era
This action should not be used for decoders that require access to original bytes, use
toPlainDecoder
instead.
fromEraCBOR ∷ (Era era, DecCBOR t) ⇒ Decoder s t Source #
Convert a type that implements DecCBOR
to plain Decoder
using the lowest
protocol version for the supplied era
This action should not be used for decoders that require access to original bytes, use
toPlainDecoder
instead.
notSupportedInThisEraL ∷ HasCallStack ⇒ Lens' a b Source #
atMostEra ∷ ∀ (eraName ∷ Type → Type) era. AtMostEra eraName era ⇒ () Source #
Enforce era to be at most the specified era at the type level. In other words compiler will produce type error when applied to eras prior to the specified era. This function should be used in order to avoid redundant constraints warning.
For example these will type check
>>>
atMostEra @BabbageEra @(ShelleyEra StandardCrypto)
>>>
atMostEra @AlonzoEra @(MaryEra StandardCrypto)
However this will result in a type error
>>>
atMostEra @BabbageEra @(ConwayEra StandardCrypto)
atLeastEra ∷ ∀ (eraName ∷ Type → Type) era. AtLeastEra eraName era ⇒ () Source #
Enforce era to be at least the specified era at the type level. In other words compiler will produce type error when applied to eras prior to the specified era. This function should be used in order to avoid redundant constraints warning.
For example these will type check
>>>
atLeastEra @BabbageEra @(ConwayEra StandardCrypto)
>>>
atLeastEra @BabbageEra @(BabbageEra StandardCrypto)
However this will result in a type error
>>>
atLeastEra @BabbageEra @(AlonzoEra StandardCrypto)
eraProtVersions ∷ Era era ⇒ [Version] Source #
List with all major versions that are used in the particular era.
eraProtVerHigh ∷ Era era ⇒ Version Source #
Get the value level Version
of the highest major protocol version for the supplied era
.
eraProtVerLow ∷ Era era ⇒ Version Source #
Get the value level Version
of the lowest major protocol version for the supplied era
.
absurdEraRule ∷ ∀ (rule ∷ Symbol) era a. VoidEraRule rule era → a Source #
type family ProtVerHigh era ∷ Nat Source #
Highest major protocol version for this era. By default se to ProtVerLow
Instances
type ProtVerHigh (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type ProtVerHigh (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Era |
type family ProtVerLow era ∷ Nat Source #
Lowest major protocol version for this era
Instances
type ProtVerLow (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type ProtVerLow (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Era |
type family PreviousEra era = (r ∷ Type) | r → era Source #
Map an era to its predecessor.
For example:
type instance PreviousEra (AllegraEra c) = ShelleyEra c
Instances
type PreviousEra (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type PreviousEra (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Era |
type family EraCrypto era Source #
Instances
type EraCrypto (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type EraCrypto (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Era |
class (Crypto (EraCrypto era), Typeable era, KnownNat (ProtVerLow era), KnownNat (ProtVerHigh era), ProtVerLow era <= ProtVerHigh era, MinVersion <= ProtVerLow era, MinVersion <= ProtVerHigh era, CmpNat (ProtVerLow era) MaxVersion ~ 'LT, CmpNat (ProtVerHigh era) MaxVersion ~ 'LT, ProtVerLow era <= MaxVersion, ProtVerHigh era <= MaxVersion) ⇒ Era era where Source #
type PreviousEra era = (r ∷ Type) | r → era Source #
Map an era to its predecessor.
For example:
type instance PreviousEra (AllegraEra c) = ShelleyEra c
type ProtVerLow era ∷ Nat Source #
Lowest major protocol version for this era
type ProtVerHigh era ∷ Nat Source #
Highest major protocol version for this era. By default se to ProtVerLow
type ProtVerHigh era = ProtVerLow era
Textual name of the current era.
Designed to be used with TypeApplications
:
>>>
eraName @(ByronEra StandardCrypto)
Byron
Instances
Crypto c ⇒ Era (ByronEra c) | |
Crypto c ⇒ Era (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Era type EraCrypto (ShelleyEra c) Source # type PreviousEra (ShelleyEra c) = (r ∷ Type) Source # type ProtVerLow (ShelleyEra c) ∷ Nat Source # type ProtVerHigh (ShelleyEra c) ∷ Nat Source # |
This is the era that preceded Shelley era. It cannot have any other class instances,
except for Era
type class.
Instances
Crypto c ⇒ Era (ByronEra c) | |
type EraCrypto (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type PreviousEra (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type ProtVerHigh (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era | |
type ProtVerLow (ByronEra c) | |
Defined in Cardano.Ledger.Core.Era |
type family EraRule (rule ∷ Symbol) era = (r ∷ Type) | r → rule Source #
Era STS map
Instances
type family EraRuleFailure (rule ∷ Symbol) era = (r ∷ Type) | r → rule era Source #
EraRuleFailure
type family is needed for injectivity, which STS' PredicateFailure
does not provide for us unfortunately.
Instances
type family EraRuleEvent (rule ∷ Symbol) era = (r ∷ Type) | r → rule era Source #
Instances
type EraRuleEvent "LEDGER" (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.Ledger | |
type EraRuleEvent "LEDGERS" (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.Ledgers | |
type EraRuleEvent "NEWEPOCH" (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.NewEpoch | |
type EraRuleEvent "POOLREAP" (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.PoolReap | |
type EraRuleEvent "TICK" (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.Tick |
data VoidEraRule (rule ∷ Symbol) era Source #
This is a type with no inhabitans for the rules. It is used to indicate that a rule does not have a predicate failure as well as marking rules that have been disabled when comparing to prior eras.
Instances
class EraRuleFailure rule era ~ PredicateFailure (EraRule rule era) ⇒ InjectRuleFailure (rule ∷ Symbol) (t ∷ Type → TYPE LiftedRep) era where Source #
Nothing
injectFailure ∷ t era → EraRuleFailure rule era Source #
Instances
class EraRuleEvent rule era ~ Event (EraRule rule era) ⇒ InjectRuleEvent (rule ∷ Symbol) (t ∷ Type → TYPE LiftedRep) era where Source #
Nothing
injectEvent ∷ t era → EraRuleEvent rule era Source #
type family ProtVerAtLeast era (l ∷ Nat) where ... Source #
Requirement for the era's highest protocol version to be higher or equal to the supplied value
ProtVerAtLeast era l = ProtVerIsInBounds "at least" era l (l <=? ProtVerHigh era) |
type family ProtVerAtMost era (h ∷ Nat) where ... Source #
Requirement for the era's lowest protocol version to be lower or equal to the supplied value
ProtVerAtMost era h = ProtVerIsInBounds "at most" era h (ProtVerLow era <=? h) |
type ProtVerInBounds era (l ∷ Nat) (h ∷ Nat) = (ProtVerAtLeast era l, ProtVerAtMost era h) Source #
Restrict a lower and upper bounds of the protocol version for the particular era
type ExactEra (inEra ∷ Type → Type) era = ProtVerInBounds era (ProtVerLow (inEra (EraCrypto era))) (ProtVerHigh (inEra (EraCrypto era))) Source #
Restrict an era to the specific era through the protocol version. This is
equivalent to (inEra (Crypto era) ~ era)
type AtLeastEra (eraName ∷ Type → Type) era = ProtVerAtLeast era (ProtVerLow (eraName (EraCrypto era))) Source #
Restrict the era
to equal to eraName
or come after it
type AtMostEra (eraName ∷ Type → Type) era = ProtVerAtMost era (ProtVerHigh (eraName (EraCrypto era))) Source #
Restrict the era
to equal to eraName
or come before it.