ScriptDataHashGenerator

scalus.cardano.ledger.ScriptDataHashGenerator

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Computes the script data hash for the given redeemers, datums, and used cost models.

Computes the script data hash for the given redeemers, datums, and used cost models.

The script data hash is computed as the Blake2b-256 hash of the concatenation of:

  • the CBOR encoding of the redeemers (or an empty map if none)
  • the CBOR encoding of the datums (or an empty string if none)
  • the CBOR encoding of the cost models

Attributes

Note

It's a low-level function that does not check if the redeemers and datums are actually used in the transaction. Use it if you know what you're doing.

def computeScriptDataHash(witnessSet: TransactionWitnessSet, protocolParams: ProtocolParams, usedLanguages: TreeSet[Language], redeemers: Option[KeepRaw[Redeemers]], datums: KeepRaw[TaggedSortedMap[DataHash, KeepRaw[Data]]]): Option[ScriptDataHash]

Computes the script data hash for the given transaction witness set, protocol parameters, used languages, redeemers, and datums.

Computes the script data hash for the given transaction witness set, protocol parameters, used languages, redeemers, and datums.

If there are no redeemers, no datums, and no cost models, returns None.

Attributes

Note

Use it if you know what you're doing.

Computes the script data hash for the given transaction and UTxO set.

Computes the script data hash for the given transaction and UTxO set.

If there are no redeemers, no datums, and no cost models, returns None.

Value parameters

protocolParams

The protocol parameters to use for getting the cost models.

transaction

The transaction to compute the script data hash for.

utxos

The UTxO set to use for resolving inputs and reference inputs.

Attributes

Returns

Either a BadInputsUTxOException or BadReferenceInputsUTxOException if some inputs or reference inputs are missing in the UTxO set, or an Option[ScriptDataHash] if successful.