cardano-ledger-core-1.14.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) c 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.

Constructors

ScriptHashObj !(ScriptHash c) 
KeyHashObj !(KeyHash kr c) 

Instances

Instances details
HasKeyRole Credential Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

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

Crypto c ⇒ FromJSON (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Crypto c ⇒ FromJSONKey (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Crypto c ⇒ ToJSON (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Crypto c ⇒ ToJSONKey (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Generic (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep (Credential kr c) ∷ TypeType Source #

Methods

fromCredential kr c → Rep (Credential kr c) x Source #

toRep (Credential kr c) x → Credential kr c Source #

Show (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

showsPrecIntCredential kr c → ShowS Source #

showCredential kr c → String Source #

showList ∷ [Credential kr c] → ShowS Source #

(Typeable kr, Crypto c) ⇒ FromCBOR (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

fromCBORDecoder s (Credential kr c) Source #

labelProxy (Credential kr c) → Text Source #

(Typeable kr, Crypto c) ⇒ ToCBOR (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

toCBORCredential kr c → Encoding Source #

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

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

(Typeable kr, Crypto c) ⇒ DecCBOR (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

decCBORDecoder s (Credential kr c) Source #

dropCBORProxy (Credential kr c) → Decoder s () Source #

labelProxy (Credential kr c) → Text Source #

(Typeable kr, Crypto c) ⇒ EncCBOR (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

encCBORCredential kr c → Encoding Source #

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

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

Crypto e ⇒ Default (Credential r e) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

defCredential r e Source #

NFData (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfCredential kr c → () Source #

Eq (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

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

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

Ord (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

compareCredential kr c → Credential kr c → Ordering Source #

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

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

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

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

maxCredential kr c → Credential kr c → Credential kr c Source #

minCredential kr c → Credential kr c → Credential kr c Source #

NoThunks (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (Credential kr c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

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

newtype GenesisCredential c Source #

Instances

Instances details
Generic (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep (GenesisCredential c) ∷ TypeType Source #

Show (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Crypto c ⇒ ToCBOR (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Crypto c ⇒ EncCBOR (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Eq (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Ord (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (GenesisCredential c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (GenesisCredential c) = D1 ('MetaData "GenesisCredential" "Cardano.Ledger.Credential" "cardano-ledger-core-1.14.0.0-inplace" 'True) (C1 ('MetaCons "GenesisCredential" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGenesisCredential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (KeyHash 'Genesis c))))

credKeyHashWitnessCredential r c → Maybe (KeyHash 'Witness c) Source #

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

credScriptHashCredential kr c → Maybe (ScriptHash c) Source #

Extract ScriptHash from a Credential. Returns Nothing for KeyHashes

parseCredential ∷ (MonadFail m, Crypto c) ⇒ Text → m (Credential kr c) Source #

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 c Source #

Instances

Instances details
Crypto c ⇒ ToJSON (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Generic (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Associated Types

type Rep (StakeReference c) ∷ TypeType Source #

Show (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

NFData (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

rnfStakeReference c → () Source #

Eq (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

Ord (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

NoThunks (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (StakeReference c) Source # 
Instance details

Defined in Cardano.Ledger.Credential

type Rep (StakeReference c) = D1 ('MetaData "StakeReference" "Cardano.Ledger.Credential" "cardano-ledger-core-1.14.0.0-inplace" 'False) (C1 ('MetaCons "StakeRefBase" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StakeCredential c))) :+: (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.