cardano-ledger-shelley-1.16.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.TxCert

Synopsis

Documentation

class EraTxCert era ⇒ ShelleyEraTxCert era where Source #

pattern MirTxCert ∷ (ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ MIRCertTxCert era Source #

data ShelleyDelegCert Source #

Constructors

ShelleyRegCert !StakeCredential

A stake credential registration certificate.

ShelleyUnRegCert !StakeCredential

A stake credential deregistration certificate.

ShelleyDelegCert !StakeCredential !(KeyHash 'StakePool)

A stake delegation certificate.

Instances

Instances details
ToJSON ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Generic ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Associated Types

type Rep ShelleyDelegCertTypeType Source #

Show ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NFData ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

rnfShelleyDelegCert → () Source #

Eq ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Ord ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NoThunks ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep ShelleyDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

data ShelleyTxCert era Source #

A heavyweight certificate.

Instances

Instances details
Era era ⇒ ToJSON (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Generic (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Associated Types

type Rep (ShelleyTxCert era) ∷ TypeType Source #

Methods

fromShelleyTxCert era → Rep (ShelleyTxCert era) x Source #

toRep (ShelleyTxCert era) x → ShelleyTxCert era Source #

Show (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

(ShelleyEraTxCert era, TxCert era ~ ShelleyTxCert era) ⇒ FromCBOR (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Era era ⇒ ToCBOR (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

toCBORShelleyTxCert era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyTxCert era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyTxCert era] → Size Source #

(ShelleyEraTxCert era, TxCert era ~ ShelleyTxCert era) ⇒ DecCBOR (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Era era ⇒ EncCBOR (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

encCBORShelleyTxCert era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyTxCert era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyTxCert era] → Size Source #

NFData (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

rnfShelleyTxCert era → () Source #

Eq (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

(==)ShelleyTxCert era → ShelleyTxCert era → Bool Source #

(/=)ShelleyTxCert era → ShelleyTxCert era → Bool Source #

Ord (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NoThunks (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep (ShelleyTxCert era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep (ShelleyTxCert era) = D1 ('MetaData "ShelleyTxCert" "Cardano.Ledger.Shelley.TxCert" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) ((C1 ('MetaCons "ShelleyTxCertDelegCert" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShelleyDelegCert)) :+: C1 ('MetaCons "ShelleyTxCertPool" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PoolCert))) :+: (C1 ('MetaCons "ShelleyTxCertGenesisDeleg" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenesisDelegCert)) :+: C1 ('MetaCons "ShelleyTxCertMir" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MIRCert))))

GenesisDelegCert

data GenesisDelegCert Source #

Genesis key delegation certificate

Instances

Instances details
ToJSON GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Generic GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Associated Types

type Rep GenesisDelegCertTypeType Source #

Show GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NFData GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

rnfGenesisDelegCert → () Source #

Eq GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Ord GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NoThunks GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep GenesisDelegCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

MIRCert

data MIRCert Source #

Move instantaneous rewards certificate

Constructors

MIRCert 

Fields

Instances

Instances details
ToJSON MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Generic MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Associated Types

type Rep MIRCertTypeType Source #

Methods

fromMIRCertRep MIRCert x Source #

toRep MIRCert x → MIRCert Source #

Show MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

DecCBOR MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

EncCBOR MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

encCBORMIRCertEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy MIRCertSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [MIRCert] → Size Source #

NFData MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

rnfMIRCert → () Source #

Eq MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

(==)MIRCertMIRCertBool Source #

(/=)MIRCertMIRCertBool Source #

Ord MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NoThunks MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep MIRCert Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep MIRCert = D1 ('MetaData "MIRCert" "Cardano.Ledger.Shelley.TxCert" "cardano-ledger-shelley-1.16.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)))

data MIRPot Source #

Constructors

ReservesMIR 
TreasuryMIR 

Instances

Instances details
ToJSON MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Bounded MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Enum MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Generic MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Associated Types

type Rep MIRPotTypeType Source #

Methods

fromMIRPotRep MIRPot x Source #

toRep MIRPot x → MIRPot Source #

Show MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

DecCBOR MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

EncCBOR MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

encCBORMIRPotEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy MIRPotSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [MIRPot] → Size Source #

NFData MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

rnfMIRPot → () Source #

Eq MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

(==)MIRPotMIRPotBool Source #

(/=)MIRPotMIRPotBool Source #

Ord MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NoThunks MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep MIRPot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep MIRPot = D1 ('MetaData "MIRPot" "Cardano.Ledger.Shelley.TxCert" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "ReservesMIR" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "TreasuryMIR" 'PrefixI 'False) (U1TypeType))

data MIRTarget 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

Instances details
ToJSON MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Generic MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Associated Types

type Rep MIRTargetTypeType Source #

Show MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

DecCBOR MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

EncCBOR MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

encCBORMIRTargetEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy MIRTargetSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [MIRTarget] → Size Source #

NFData MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Methods

rnfMIRTarget → () Source #

Eq MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

Ord MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

NoThunks MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep MIRTarget Source # 
Instance details

Defined in Cardano.Ledger.Shelley.TxCert

type Rep MIRTarget = D1 ('MetaData "MIRTarget" "Cardano.Ledger.Shelley.TxCert" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "StakeAddressesMIR" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) DeltaCoin))) :+: C1 ('MetaCons "SendToOppositePotMIR" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

isDelegationShelleyEraTxCert era ⇒ TxCert era → Bool Source #

Check for ShelleyDelegCert constructor

isRegPoolEraTxCert era ⇒ TxCert era → Bool Source #

Check for RegPool constructor

isRetirePoolEraTxCert era ⇒ TxCert era → Bool Source #

Check for RetirePool constructor

isGenesisDelegation ∷ (ShelleyEraTxCert era, ProtVerAtMost era 8) ⇒ TxCert era → Bool Source #

Check for GenesisDelegate constructor

Serialization helpers

Deposits and Refunds

shelleyTotalDepositsTxCerts Source #

Arguments

∷ (EraPParams era, Foldable f, EraTxCert era) 
PParams era 
→ (KeyHash 'StakePoolBool)

Check whether a pool with a supplied PoolStakeId is already registered.

→ f (TxCert era) 
Coin 

Determine the total deposit amount needed from a TxBody. The block may (legitimately) contain multiple registration certificates for the same pool, where the first will be treated as a registration and any subsequent ones as re-registration. As such, we must only take a deposit for the first such registration. It is even possible for a single transaction to have multiple pool registration for the same pool, so as we process pool registrations, we must keep track of those that are already registered, so we do not add a Deposit for the same pool twice.

Note that this is not an issue for key registrations since subsequent registration certificates would be invalid.

shelleyTotalRefundsTxCerts Source #

Arguments

∷ (EraPParams era, Foldable f, EraTxCert era) 
PParams era 
→ (StakeCredentialMaybe Coin)

Function that can lookup current deposit, in case when the stake key is registered.

→ f (TxCert era) 
Coin 

Compute the key deregistration refunds in a transaction

Re-exports

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 #

Associated Types

type TxCert era = (r ∷ Type) | r → era Source #

type TxCertUpgradeError era Source #

Methods

upgradeTxCertTxCert (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.

getVKeyWitnessTxCertTxCert era → Maybe (KeyHash 'Witness) Source #

Return a witness key whenever a certificate requires one

getScriptWitnessTxCertTxCert era → Maybe ScriptHash Source #

Return a ScriptHash for certificate types that require a witness

mkRegPoolTxCertPoolParamsTxCert era Source #

getRegPoolTxCertTxCert era → Maybe PoolParams Source #

mkRetirePoolTxCertKeyHash 'StakePoolEpochNoTxCert era Source #

getRetirePoolTxCertTxCert era → Maybe (KeyHash 'StakePool, EpochNo) Source #

lookupRegStakeTxCertTxCert era → Maybe (Credential 'Staking) Source #

Extract staking credential from any certificate that can register such credential

lookupUnRegStakeTxCertTxCert era → Maybe (Credential 'Staking) Source #

Extract staking credential from any certificate that can unregister such credential

getTotalDepositsTxCerts Source #

Arguments

Foldable f 
PParams era 
→ (KeyHash 'StakePoolBool)

Check whether stake pool is registered or not

→ f (TxCert era) 
Coin 

Compute the total deposits from a list of certificates.

getTotalRefundsTxCerts Source #

Arguments

Foldable f 
PParams era 
→ (Credential 'StakingMaybe Coin)

Lookup current deposit for Staking credential if one is registered

→ (Credential 'DRepRoleMaybe Coin)

Lookup current deposit for DRep credential if one is registered

→ f (TxCert era) 
Coin 

Compute the total refunds from a list of certificates.

pattern RegPoolTxCertEraTxCert era ⇒ PoolParamsTxCert era Source #

data PoolCert Source #

Constructors

RegPool !PoolParams

A stake pool registration certificate.

RetirePool !(KeyHash 'StakePool) !EpochNo

A stake pool retirement certificate.

Instances

Instances details
ToJSON PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

Generic PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

Associated Types

type Rep PoolCertTypeType Source #

Show PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

EncCBOR PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

Methods

encCBORPoolCertEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy PoolCertSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [PoolCert] → Size Source #

NFData PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

Methods

rnfPoolCert → () Source #

Eq PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

Ord PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

NoThunks PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

type Rep PoolCert 
Instance details

Defined in Cardano.Ledger.Core.TxCert

isRegStakeTxCertEraTxCert era ⇒ TxCert era → Bool Source #

Check if supplied TxCert is a stake registering certificate

isUnRegStakeTxCertEraTxCert era ⇒ TxCert era → Bool Source #

Check if supplied TxCert is a stake un-registering certificate

Orphan instances