Attributes
- Companion
- enum
- Graph
-
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Credential.type
Members list
Type members
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Givens
Givens
Ordering follows the ledger's Ord (Credential kr), which is derived on ScriptHashObj | KeyHashObj (libs/cardano-ledger-core/.../Credential.hs:98-101), so script credentials sort before key credentials.
Ordering follows the ledger's Ord (Credential kr), which is derived on ScriptHashObj | KeyHashObj (libs/cardano-ledger-core/.../Credential.hs:98-101), so script credentials sort before key credentials.
That is the opposite of the Plutus constructor tags (PubKeyCredential is 0, ScriptCredential is 1), and it is deliberate: V3 delivers txInfoWdrl keyed by the ledger's Credential, converted only after Map.toList has fixed the order (Conway/TxInfo.hs:697-699, :549-551). Ordering by the Plutus tags instead made withdrawals.get return None for a key that is present.
Note this does NOT apply to StakingCredential, which V1/V2 deliver in Plutus order. See the Ord[StakingCredential] instance below.
Attributes
Extensions
Extensions
The key hash of a PubKeyCredential, or fails with message for a script credential.
The key hash of a PubKeyCredential, or fails with message for a script credential.
A direct match with no intermediate Option, unlike pubKeyOption.getOrFail(message).
Attributes
- Example
-
Credential.PubKeyCredential(pkh).pubKeyHashOrFail("expected a key") === pkh Credential.ScriptCredential(hash).pubKeyHashOrFail("expected a key") // fails
The script hash of a ScriptCredential, or fails with message for a key credential.
The script hash of a ScriptCredential, or fails with message for a key credential.
A direct match with no intermediate Option, unlike scriptOption.getOrFail(message), which allocates one that nothing folds away.
Attributes
- Example
-
Credential.ScriptCredential(hash).scriptHashOrFail("expected a script") === hash Credential.PubKeyCredential(pkh).scriptHashOrFail("expected a script") // fails