cardano-ledger-core-1.17.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Credential

Synopsis

Documentation

data Credential (kr ∷ KeyRole) Source #

Script hash or key hash for a payment or a staking object.

Note that credentials (unlike raw key hashes) do appear to vary from era to era, since they reference the hash of a script, which can change. This parameter is a phantom, however, so in actuality the instances will remain the same.

Instances

Instances details
HasKeyRole Credential Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). Credential r → Credential r' Source #

FromJSON (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

FromJSONKey (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

ToJSON (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

ToJSONKey (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Generic (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep (Credential kr) ∷ TypeType Source #

Methods

fromCredential kr → Rep (Credential kr) x Source #

toRep (Credential kr) x → Credential kr Source #

Show (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Typeable kr ⇒ FromCBOR (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Typeable kr ⇒ ToCBOR (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

toCBORCredential kr → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Credential kr) → Size Source #

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

Typeable kr ⇒ DecCBOR (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Typeable kr ⇒ EncCBOR (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

encCBORCredential kr → Encoding Source #

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

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

Default (Credential r) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

defCredential r Source #

NFData (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfCredential kr → () Source #

Eq (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

(==)Credential kr → Credential kr → Bool Source #

(/=)Credential kr → Credential kr → Bool Source #

Ord (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

compareCredential kr → Credential kr → Ordering Source #

(<)Credential kr → Credential kr → Bool Source #

(<=)Credential kr → Credential kr → Bool Source #

(>)Credential kr → Credential kr → Bool Source #

(>=)Credential kr → Credential kr → Bool Source #

maxCredential kr → Credential kr → Credential kr Source #

minCredential kr → Credential kr → Credential kr Source #

NoThunks (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (Credential kr) = D1 ('MetaData "Credential" "Cardano.Ledger.Credential" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "ScriptHashObj" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptHash)) :+: C1 ('MetaCons "KeyHashObj" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash kr))))

credKeyHashWitnessCredential r → Maybe (KeyHash 'Witness) Source #

Convert a KeyHash into a Witness KeyHash. Does nothing for Script credentials.

credScriptHashCredential kr → Maybe ScriptHash Source #

Extract ScriptHash from a Credential. Returns Nothing for KeyHashes

data Ptr Source #

Pointer to a slot number, transaction index and an index in certificate list.

Constructors

Ptr !SlotNo !TxIx !CertIx 

Instances

Instances details
ToJSON Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

ToJSONKey Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Generic Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep PtrTypeType Source #

Methods

fromPtrRep Ptr x Source #

toRep Ptr x → Ptr Source #

Show Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

showsPrecIntPtrShowS Source #

showPtrString Source #

showList ∷ [Ptr] → ShowS Source #

FromCBOR Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

ToCBOR Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

toCBORPtrEncoding Source #

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

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

DecCBOR Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

EncCBOR Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

encCBORPtrEncoding Source #

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

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

DecCBORGroup Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

EncCBORGroup Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

NFData Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfPtr → () Source #

Eq Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

(==)PtrPtrBool Source #

(/=)PtrPtrBool Source #

Ord Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

comparePtrPtrOrdering Source #

(<)PtrPtrBool Source #

(<=)PtrPtrBool Source #

(>)PtrPtrBool Source #

(>=)PtrPtrBool Source #

maxPtrPtrPtr Source #

minPtrPtrPtr Source #

NoThunks Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

data StakeReference Source #

Instances

Instances details
ToJSON StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

Generic StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep StakeReferenceTypeType Source #

Show StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

NFData StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfStakeReference → () Source #

Eq StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

Ord StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

NoThunks StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep StakeReference = D1 ('MetaData "StakeReference" "Cardano.Ledger.Credential" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "StakeRefBase" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StakeCredential)) :+: (C1 ('MetaCons "StakeRefPtr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Ptr)) :+: C1 ('MetaCons "StakeRefNull" 'PrefixI 'False) (U1TypeType)))

normalizePtrPtrPtr Source #

Convert any invalid Ptr to a Ptr that contains all zeros for its fields. Any pointer that contains a SlotNo, TxIx or CertIx that is too large to fit into Word32, Word16 and Word16 respectively is considered to be an invalid Ptr. Valid Ptrs will be returned unmodified.

Note - This is in no way related to dangling pointers, with an exception that any invalid Ptr is guarateed to be a dangling Ptr.