Safe Haskell | None |
---|---|
Language | Haskell2010 |
Figure 3: Functions related to scripts Babbage Specification
Synopsis
- getDatumBabbage :: ( Era era, TxOut era ~ TxOut era, Witnesses era ~ TxWitness era) => Tx era -> UTxO era -> ScriptPurpose ( Crypto era) -> Maybe ( Data era)
- babbageTxScripts :: forall era. ( ValidateScript era, HasField "referenceScript" ( TxOut era) ( StrictMaybe ( Script era)), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "referenceInputs" ( TxBody era) ( Set ( TxIn ( Crypto era)))) => UTxO era -> Tx era -> Map ( ScriptHash ( Crypto era)) ( Script era)
- refScripts :: forall era. ( ValidateScript era, HasField "referenceScript" ( TxOut era) ( StrictMaybe ( Script era))) => Set ( TxIn ( Crypto era)) -> UTxO era -> Map ( ScriptHash ( Crypto era)) ( Script era)
- babbageInputDataHashes :: forall era. ( HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), ValidateScript era, TxOut era ~ TxOut era) => Map ( ScriptHash ( Crypto era)) ( Script era) -> ValidatedTx era -> UTxO era -> ( Set ( DataHash ( Crypto era)), Set ( TxIn ( Crypto era)))
Documentation
getDatumBabbage :: ( Era era, TxOut era ~ TxOut era, Witnesses era ~ TxWitness era) => Tx era -> UTxO era -> ScriptPurpose ( Crypto era) -> Maybe ( Data era) Source #
Extract binary data either directly from the
Tx
as an "inline datum"
or look it up in the witnesses by the hash.
babbageTxScripts :: forall era. ( ValidateScript era, HasField "referenceScript" ( TxOut era) ( StrictMaybe ( Script era)), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "referenceInputs" ( TxBody era) ( Set ( TxIn ( Crypto era)))) => UTxO era -> Tx era -> Map ( ScriptHash ( Crypto era)) ( Script era) Source #
refScripts :: forall era. ( ValidateScript era, HasField "referenceScript" ( TxOut era) ( StrictMaybe ( Script era))) => Set ( TxIn ( Crypto era)) -> UTxO era -> Map ( ScriptHash ( Crypto era)) ( Script era) Source #
Collect all the reference scripts found in the TxOuts, pointed to by some input.