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 #

Methods

fromCredential kr → Rep (Credential kr) x #

toRep (Credential kr) x → Credential kr #

Show (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

showsPrecIntCredential kr → ShowS #

showCredential kr → String #

showList ∷ [Credential kr] → ShowS #

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 r) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfCredential r → () #

Eq (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

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

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

Ord (Credential kr) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

compareCredential kr → Credential kr → Ordering #

(<)Credential kr → Credential kr → Bool #

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

(>)Credential kr → Credential kr → Bool #

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

maxCredential kr → Credential kr → Credential kr #

minCredential kr → Credential kr → Credential kr #

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

Defined in Cardano.Ledger.Credential

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 !SlotNo32 !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 #

Methods

fromPtrRep Ptr x #

toRep Ptr x → Ptr #

Show Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

showsPrecIntPtrShowS #

showPtrString #

showList ∷ [Ptr] → ShowS #

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 → () #

Eq Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

(==)PtrPtrBool #

(/=)PtrPtrBool #

Ord Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

comparePtrPtrOrdering #

(<)PtrPtrBool #

(<=)PtrPtrBool #

(>)PtrPtrBool #

(>=)PtrPtrBool #

maxPtrPtrPtr #

minPtrPtrPtr #

NoThunks Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep Ptr Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep Ptr = D1 ('MetaData "Ptr" "Cardano.Ledger.Credential" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "Ptr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 SlotNo32) :*: (S1 ('MetaSel ('NothingMaybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 TxIx) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 CertIx))))

mkPtrNormalizedWord64Word64Word64Ptr Source #

Construct a valid Ptr, while protecting against overflow. Constructs a Ptr with all zeros for its fields, whenever either one of them doesn't fit in without overflowing. 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 and result in all values to be clamped to zero. In case of all valid arguments the Ptrs will be constructed with values unmodified.

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

newtype SlotNo32 Source #

Pointers have been deprecated and aren't used anymore. For this reason we can safely use Word32 for slots in pointers

Constructors

SlotNo32 Word32 

Instances

Instances details
FromJSON SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

ToJSON SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Bounded SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Generic SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep SlotNo32TypeType #

Methods

fromSlotNo32Rep SlotNo32 x #

toRep SlotNo32 x → SlotNo32 #

Num SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Show SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

showsPrecIntSlotNo32ShowS #

showSlotNo32String #

showList ∷ [SlotNo32] → ShowS #

FromCBOR SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

ToCBOR SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

toCBORSlotNo32Encoding Source #

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

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

DecCBOR SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

EncCBOR SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

encCBORSlotNo32Encoding Source #

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

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

NFData SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfSlotNo32 → () #

Eq SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

(==)SlotNo32SlotNo32Bool #

(/=)SlotNo32SlotNo32Bool #

Ord SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

NoThunks SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep SlotNo32 Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep SlotNo32 = D1 ('MetaData "SlotNo32" "Cardano.Ledger.Credential" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "SlotNo32" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

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 #

Show StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

NFData StakeReference Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfStakeReference → () #

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 #

Deprecated: Starting with Conway era all Pointers are now normalized and this logic has been moved into the decoder

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.