utils

This module contains utility functions that are used in the protocol.

Functions

is_signed_by(
  reqd_signers: List<VerificationKeyHash>,
  signer: VerificationKeyHash,
) -> Bool

Check if the given signer is included in the given list of required signers.

get_script_hash_frm_output(output: Output) -> ScriptHash

Get the validator ScriptHash from a given output. Fails if the given output is not from a validator script.

validate_returned_output_unchanged(output: Output, input: Input) -> Bool

Checks the given Output against the given Input for the following:

  1. That the value is the same
  2. That the datum is the same
  3. That the output goes back to the same address

get_lower_bound(range: ValidityRange) -> Int

Get the lower bound IntervalBound from given transaction validity range (POSIXTime in milliseconds). Fails if given validity range does not contain a Finite lower bound type

get_upper_bound(range: ValidityRange) -> Int

Get the upper bound IntervalBound from given transaction validity range (POSIXTime in milliseconds). Fails if given validity range does not contain a Finite upper bound type

Search Document