Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Credential (kr ∷ KeyRole) c
- = ScriptHashObj !(ScriptHash c)
- | KeyHashObj !(KeyHash kr c)
- newtype GenesisCredential c = GenesisCredential {}
- type PaymentCredential c = Credential 'Payment c
- credKeyHash ∷ Credential r c → Maybe (KeyHash r c)
- credKeyHashWitness ∷ Credential r c → Maybe (KeyHash 'Witness c)
- credScriptHash ∷ Credential kr c → Maybe (ScriptHash c)
- credToText ∷ Credential kr c → Text
- parseCredential ∷ (MonadFail m, Crypto c) ⇒ Text → m (Credential kr c)
- data Ptr = Ptr !SlotNo !TxIx !CertIx
- ptrSlotNo ∷ Ptr → SlotNo
- ptrTxIx ∷ Ptr → TxIx
- ptrCertIx ∷ Ptr → CertIx
- type StakeCredential c = Credential 'Staking c
- data StakeReference c
- = StakeRefBase !(StakeCredential c)
- | StakeRefPtr !Ptr
- | StakeRefNull
- normalizePtr ∷ Ptr → Ptr
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.
ScriptHashObj !(ScriptHash c) | |
KeyHashObj !(KeyHash kr c) |
Instances
newtype GenesisCredential c Source #
Instances
type PaymentCredential c = Credential 'Payment c Source #
credKeyHash ∷ Credential r c → Maybe (KeyHash r c) Source #
credKeyHashWitness ∷ Credential r c → Maybe (KeyHash 'Witness c) Source #
Convert a KeyHash into a Witness KeyHash. Does nothing for Script credentials.
credScriptHash ∷ Credential kr c → Maybe (ScriptHash c) Source #
Extract ScriptHash from a Credential. Returns Nothing for KeyHashes
credToText ∷ Credential kr c → Text Source #
parseCredential ∷ (MonadFail m, Crypto c) ⇒ Text → m (Credential kr c) Source #
Pointer to a slot number, transaction index and an index in certificate list.
Instances
ToJSON Ptr Source # | |
ToJSONKey Ptr Source # | |
Defined in Cardano.Ledger.Credential | |
Generic Ptr Source # | |
Show Ptr Source # | |
FromCBOR Ptr Source # | |
ToCBOR Ptr Source # | |
DecCBOR Ptr Source # | |
EncCBOR Ptr Source # | |
DecCBORGroup Ptr Source # | |
Defined in Cardano.Ledger.Credential decCBORGroup ∷ Decoder s Ptr Source # | |
EncCBORGroup Ptr Source # | |
NFData Ptr Source # | |
Defined in Cardano.Ledger.Credential | |
Eq Ptr Source # | |
Ord Ptr Source # | |
NoThunks Ptr Source # | |
type Rep Ptr Source # | |
Defined in Cardano.Ledger.Credential type Rep Ptr = D1 ('MetaData "Ptr" "Cardano.Ledger.Credential" "cardano-ledger-core-1.15.0.0-inplace" 'False) (C1 ('MetaCons "Ptr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxIx) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CertIx)))) |
type StakeCredential c = Credential 'Staking c Source #
data StakeReference c Source #
Instances
normalizePtr ∷ Ptr → Ptr 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 Ptr
s 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
.