| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Credential
Synopsis
- data Credential (kr ∷ KeyRole)
- = ScriptHashObj !ScriptHash
- | KeyHashObj !(KeyHash kr)
- type PaymentCredential = Credential 'Payment
- credKeyHash ∷ ∀ (r ∷ KeyRole). Credential r → Maybe (KeyHash r)
- credKeyHashWitness ∷ ∀ (r ∷ KeyRole). Credential r → Maybe (KeyHash 'Witness)
- credScriptHash ∷ ∀ (kr ∷ KeyRole). Credential kr → Maybe ScriptHash
- credToText ∷ ∀ (kr ∷ KeyRole). Credential kr → Text
- parseCredential ∷ ∀ m (kr ∷ KeyRole). MonadFail m ⇒ Text → m (Credential kr)
- data Ptr = Ptr !SlotNo32 !TxIx !CertIx
- mkPtrNormalized ∷ Word64 → Word64 → Word64 → Ptr
- ptrSlotNo ∷ Ptr → SlotNo
- ptrTxIx ∷ Ptr → TxIx
- ptrCertIx ∷ Ptr → CertIx
- newtype SlotNo32 = SlotNo32 Word32
- type StakeCredential = Credential 'Staking
- data StakeReference
- = StakeRefBase !(Credential 'Staking)
- | StakeRefPtr !Ptr
- | StakeRefNull
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.
Constructors
| ScriptHashObj !ScriptHash | |
| KeyHashObj !(KeyHash kr) |
Instances
type PaymentCredential = Credential 'Payment Source #
Deprecated: In favor of `Credential Payment`
credKeyHash ∷ ∀ (r ∷ KeyRole). Credential r → Maybe (KeyHash r) Source #
credKeyHashWitness ∷ ∀ (r ∷ KeyRole). Credential r → Maybe (KeyHash 'Witness) Source #
Convert a KeyHash into a Witness KeyHash. Does nothing for Script credentials.
credScriptHash ∷ ∀ (kr ∷ KeyRole). Credential kr → Maybe ScriptHash Source #
Extract ScriptHash from a Credential. Returns Nothing for KeyHashes
credToText ∷ ∀ (kr ∷ KeyRole). Credential kr → Text Source #
parseCredential ∷ ∀ m (kr ∷ KeyRole). MonadFail m ⇒ Text → m (Credential kr) 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 | |||||
| FromCBOR Ptr Source # | |||||
| ToCBOR Ptr Source # | |||||
| DecCBOR Ptr Source # | |||||
| EncCBOR Ptr Source # | |||||
| DecCBORGroup Ptr Source # | |||||
Defined in Cardano.Ledger.Credential Methods decCBORGroup ∷ Decoder s Ptr Source # | |||||
| EncCBORGroup Ptr Source # | |||||
| ToKeyValuePairs Ptr Source # | |||||
Defined in Cardano.Ledger.Credential Methods toKeyValuePairs ∷ KeyValue e kv ⇒ Ptr → [kv] Source # | |||||
| NFData Ptr Source # | |||||
Defined in Cardano.Ledger.Credential | |||||
| Generic Ptr Source # | |||||
Defined in Cardano.Ledger.Credential Associated Types
| |||||
| Show Ptr Source # | |||||
| Eq Ptr Source # | |||||
| Ord Ptr Source # | |||||
| NoThunks Ptr Source # | |||||
| Uniform Ptr Source # | |||||
Defined in Cardano.Ledger.Credential Methods uniformM ∷ StatefulGen g m ⇒ g → m Ptr Source # | |||||
| type Rep Ptr Source # | |||||
Defined in Cardano.Ledger.Credential type Rep Ptr = D1 ('MetaData "Ptr" "Cardano.Ledger.Credential" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "Ptr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 SlotNo32) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 TxIx) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 CertIx)))) | |||||
mkPtrNormalized ∷ Word64 → Word64 → Word64 → Ptr 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.
Pointers have been deprecated and aren't used anymore. For this reason we can safely use
Word32 for slots in pointers
Instances
| FromJSON SlotNo32 Source # | |||||
| ToJSON SlotNo32 Source # | |||||
| FromCBOR SlotNo32 Source # | |||||
| ToCBOR SlotNo32 Source # | |||||
| DecCBOR SlotNo32 Source # | |||||
| EncCBOR SlotNo32 Source # | |||||
| NFData SlotNo32 Source # | |||||
Defined in Cardano.Ledger.Credential | |||||
| Bounded SlotNo32 Source # | |||||
| Generic SlotNo32 Source # | |||||
Defined in Cardano.Ledger.Credential Associated Types
| |||||
| Num SlotNo32 Source # | |||||
| Show SlotNo32 Source # | |||||
| Eq SlotNo32 Source # | |||||
| Ord SlotNo32 Source # | |||||
Defined in Cardano.Ledger.Credential | |||||
| NoThunks SlotNo32 Source # | |||||
| Random SlotNo32 Source # | |||||
| Uniform SlotNo32 Source # | |||||
Defined in Cardano.Ledger.Credential Methods uniformM ∷ StatefulGen g m ⇒ g → m SlotNo32 Source # | |||||
| UniformRange SlotNo32 Source # | |||||
| type Rep SlotNo32 Source # | |||||
Defined in Cardano.Ledger.Credential | |||||
type StakeCredential = Credential 'Staking Source #
Deprecated: In favor of `Credential Staking`
data StakeReference Source #
Constructors
| StakeRefBase !(Credential 'Staking) | |
| StakeRefPtr !Ptr | |
| StakeRefNull |
Instances
| ToJSON StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential Methods toJSON ∷ StakeReference → Value Source # toEncoding ∷ StakeReference → Encoding Source # toJSONList ∷ [StakeReference] → Value Source # | |||||
| NFData StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential Methods rnf ∷ StakeReference → () # | |||||
| Generic StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential Associated Types
| |||||
| Show StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential Methods showsPrec ∷ Int → StakeReference → ShowS # show ∷ StakeReference → String # showList ∷ [StakeReference] → ShowS # | |||||
| Eq StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential Methods (==) ∷ StakeReference → StakeReference → Bool # (/=) ∷ StakeReference → StakeReference → Bool # | |||||
| Ord StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential Methods compare ∷ StakeReference → StakeReference → Ordering # (<) ∷ StakeReference → StakeReference → Bool # (<=) ∷ StakeReference → StakeReference → Bool # (>) ∷ StakeReference → StakeReference → Bool # (>=) ∷ StakeReference → StakeReference → Bool # | |||||
| NoThunks StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential | |||||
| type Rep StakeReference Source # | |||||
Defined in Cardano.Ledger.Credential type Rep StakeReference = D1 ('MetaData "StakeReference" "Cardano.Ledger.Credential" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "StakeRefBase" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Credential 'Staking))) :+: (C1 ('MetaCons "StakeRefPtr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Ptr)) :+: C1 ('MetaCons "StakeRefNull" 'PrefixI 'False) (U1 ∷ Type → Type))) | |||||