Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- predsTests ∷ TestTree
- txBodySize ∷ ∀ era. Reflect era ⇒ TxBody era → Int
- byteSize ∷ ∀ era a. (EncCBOR a, Reflect era) ⇒ Proof era → a → Int
- byteSizeT ∷ ∀ era a. (EncCBOR a, Reflect era) ⇒ Term era a → Target era Int
- txFL ∷ Lens' (TxF era) (Tx era)
- computeFinalFee ∷ EraUTxO era ⇒ PParamsF era → TxF era → Map TxIn (TxOutF era) → Coin
- integrityHash ∷ Era era1 ⇒ Proof era1 → Term era2 (PParamsF era1) → Term era2 (Set Language) → Term era2 (Map (PlutusPointerF era1) (Data era1, ExUnits)) → Term era2 (Map DataHash (Data era1)) → Target era2 (Maybe ScriptIntegrityHash)
- needT ∷ ∀ era. EraUTxO era ⇒ Proof era → Target era (TxBodyF era → Map TxIn (TxOutF era) → ScriptsNeededF era)
- rdmrPtrsT ∷ AlonzoEraScript era ⇒ Target era ([(PlutusPurposeF era, ScriptHash)] → Map ScriptHash any → Set (PlutusPointerF era))
- getRdmrPtrs ∷ AlonzoEraScript era ⇒ [(PlutusPurposeF era, ScriptHash)] → Map ScriptHash any → Set (PlutusPointerF era)
- getPlutusDataHashes ∷ (AlonzoEraTxOut era, EraTxBody era, AlonzoEraScript era) ⇒ Map TxIn (TxOutF era) → TxBodyF era → Map ScriptHash (ScriptF era) → Set DataHash
- bootWitsT ∷ Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxBodyF era → Map (KeyHash 'Payment) (Addr, SigningKey) → Set BootstrapWitness
- hashBody ∷ Proof era → TxBody era → Hash HASH EraIndependentTxBody
- sufficientGenDelegs ∷ Map k GenDelegPair → Set (KeyHash 'Witness)
- sufficientTxCert ∷ ∀ era. Reflect era ⇒ [TxCertF era] → Map (KeyHash 'Genesis) GenDelegPair → Set (KeyHash 'Witness)
- sufficientScriptKeys ∷ Proof era → Map ScriptHash (ScriptF era) → Set (KeyHash 'Witness)
- sufficientKeyHashes ∷ Reflect era ⇒ Proof era → Map ScriptHash (ScriptF era) → [TxCertF era] → Map (KeyHash 'Genesis) GenDelegPair → Set (KeyHash 'Witness)
- pcUtxo ∷ Reflect era ⇒ Map TxIn (TxOutF era) → String
- pcUtxoDoc ∷ Reflect era ⇒ Map TxIn (TxOutF era) → PDoc
- necessaryKeyHashTarget ∷ ∀ era. Reflect era ⇒ Term era (TxBodyF era) → Term era (Set (KeyHash 'Witness)) → Target era (Set (KeyHash 'Witness))
- necessaryKeyHashes ∷ ∀ era. Reflect era ⇒ TxBodyF era → Map TxIn (TxOutF era) → Map (KeyHash 'Genesis) GenDelegPair → Set (KeyHash 'Witness) → Set (KeyHash 'Witness)
- makeKeyWitnessTarget ∷ Reflect era ⇒ Term era (TxBodyF era) → Term era (Set (KeyHash 'Witness)) → Term era (Set (KeyHash 'Witness)) → Term era (Map ScriptHash (ScriptF era)) → Term era (Map (KeyHash 'Payment) (Addr, SigningKey)) → Target era (Set (WitVKey 'Witness))
- makeKeyWitness ∷ ∀ era. Reflect era ⇒ TxBodyF era → Set (KeyHash 'Witness) → Set (KeyHash 'Witness) → Map (KeyHash 'Witness) (KeyPair 'Witness) → Map ScriptHash (ScriptF era) → Map (KeyHash 'Genesis) GenDelegPair → Map (KeyHash 'Payment) (Addr, SigningKey) → Set (WitVKey 'Witness)
- allValid ∷ [IsValid] → IsValid
- scriptWitsLangs ∷ Map k (ScriptF era) → Set Language
- adjustNeededByRefScripts ∷ Proof era → Set TxIn → Set TxIn → Map TxIn (TxOutF era) → Set ScriptHash → Set ScriptHash
- getUtxoCoinT ∷ Reflect era ⇒ Term era TxIn → Term era (Map TxIn (TxOutF era)) → Target era Coin
- getNTxOut ∷ (HasCallStack, Reflect era) ⇒ Size → TxOutF era → [TxOutF era] → [TxOutF era]
- txoutSum ∷ ∀ era t. (Foldable t, Reflect era) ⇒ t (TxOutF era) → Value era
- minusMultiValue ∷ ∀ era. Proof era → Value era → Value era → Map ScriptHash (Map AssetName Integer)
- txBodyPreds ∷ ∀ era. (HasCallStack, Reflect era) ⇒ UnivSize → Proof era → [Pred era]
- txBodyStage ∷ Reflect era ⇒ UnivSize → Proof era → Subst era → Gen (Subst era)
- balanceMap ∷ Ord k ⇒ [(k, Coin)] → Map k t → Lens' t Coin → Map k t
- adjustFeeInput ∷ (HasCallStack, Reflect era) ⇒ Env era → Typed (Env era)
- adjustColInput ∷ (HasCallStack, Reflect era) ⇒ Env era → Typed (Gen (Env era))
- adjustC ∷ (Ord k, Show k) ⇒ [k] → Map k v → Coin → Lens' v Coin → Maybe (Map k v)
- updateVal ∷ (a → b → a) → Term era a → b → Env era → Typed (Env era)
- updateTerm ∷ (a → b → a) → Term era a → Term era b → Env era → Typed (Env era)
- updateTarget ∷ (a → b → a) → Term era a → Target era b → Env era → Typed (Env era, b)
- override ∷ x → x → x
- genTxAndLedger ∷ Reflect era ⇒ UnivSize → Proof era → Gen (LedgerState era, Tx era, Env era)
- genTxAndNewEpoch ∷ Reflect era ⇒ UnivSize → Proof era → Gen (NewEpochState era, Tx era, Env era)
- demoTxNes ∷ IO ()
- demoTx ∷ IO ()
- gone ∷ Gen (IO ())
- test ∷ Maybe Int → IO ()
- bad ∷ [Int]
- go ∷ Int → IO ()
- pgenTxBodyField ∷ Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxBodyField era → [(Text, PDoc)]
- pgenTxBody ∷ Reflect era ⇒ Proof era → TxBody era → Map TxIn (TxOutF era) → PDoc
- pgenTxField ∷ ∀ era. Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxField era → [(Text, PDoc)]
- pgenTx ∷ Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → Tx era → PDoc
- pcTxWithUTxO ∷ Reflect era ⇒ Proof era → UTxO era → Tx era → PDoc
- oneTest ∷ (Reflect era, Environment (EraRule "LEDGER" era) ~ LedgerEnv era, State (EraRule "LEDGER" era) ~ LedgerState era, Signal (EraRule "LEDGER" era) ~ Tx era, Show (PredicateFailure (EraRule "LEDGER" era))) ⇒ UnivSize → Proof era → Gen Property
- main1 ∷ IO ()
- main2 ∷ IO ()
- demo ∷ ReplMode → IO ()
- demoTest ∷ TestTree
- main ∷ IO ()
Documentation
integrityHash ∷ Era era1 ⇒ Proof era1 → Term era2 (PParamsF era1) → Term era2 (Set Language) → Term era2 (Map (PlutusPointerF era1) (Data era1, ExUnits)) → Term era2 (Map DataHash (Data era1)) → Target era2 (Maybe ScriptIntegrityHash) Source #
needT ∷ ∀ era. EraUTxO era ⇒ Proof era → Target era (TxBodyF era → Map TxIn (TxOutF era) → ScriptsNeededF era) Source #
"Construct the Scripts Needed to compute the Script Witnesses from the UTxO and the partial TxBody
rdmrPtrsT ∷ AlonzoEraScript era ⇒ Target era ([(PlutusPurposeF era, ScriptHash)] → Map ScriptHash any → Set (PlutusPointerF era)) Source #
getRdmrPtrs ∷ AlonzoEraScript era ⇒ [(PlutusPurposeF era, ScriptHash)] → Map ScriptHash any → Set (PlutusPointerF era) Source #
getPlutusDataHashes ∷ (AlonzoEraTxOut era, EraTxBody era, AlonzoEraScript era) ⇒ Map TxIn (TxOutF era) → TxBodyF era → Map ScriptHash (ScriptF era) → Set DataHash Source #
bootWitsT ∷ Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxBodyF era → Map (KeyHash 'Payment) (Addr, SigningKey) → Set BootstrapWitness Source #
sufficientGenDelegs ∷ Map k GenDelegPair → Set (KeyHash 'Witness) Source #
Get enough GenDeleg KeyHashes to satisfy the quorum constraint.
sufficientTxCert ∷ ∀ era. Reflect era ⇒ [TxCertF era] → Map (KeyHash 'Genesis) GenDelegPair → Set (KeyHash 'Witness) Source #
sufficientScriptKeys ∷ Proof era → Map ScriptHash (ScriptF era) → Set (KeyHash 'Witness) Source #
Compute sufficient set of keys to make the scripts succeed.
The script map is the map of all needed
scripts. Some of those
scripts may NOT be in the scriptWits
(those which are reference scripts)
but all needed scripts will need to have their KeyHashes added.
sufficientKeyHashes ∷ Reflect era ⇒ Proof era → Map ScriptHash (ScriptF era) → [TxCertF era] → Map (KeyHash 'Genesis) GenDelegPair → Set (KeyHash 'Witness) Source #
necessaryKeyHashTarget ∷ ∀ era. Reflect era ⇒ Term era (TxBodyF era) → Term era (Set (KeyHash 'Witness)) → Target era (Set (KeyHash 'Witness)) Source #
necessaryKeyHashes ∷ ∀ era. Reflect era ⇒ TxBodyF era → Map TxIn (TxOutF era) → Map (KeyHash 'Genesis) GenDelegPair → Set (KeyHash 'Witness) → Set (KeyHash 'Witness) Source #
Compute the needed key witnesses from a transaction body.
First find all the key hashes from every use of keys in the transaction
Then find the KeyPair's associated with those hashes, then
using the hash of the TxBody, turn the KeyPair into a witness.
In Eras Shelley to Mary, reqsigners
should be empty. In Eras Alonzo to Conway
we will need to add the witnesses for the required signer hashes, so they are
passed in. To compute the witnsses we need the hash of the TxBody. We will call this function
twice. Once when we have constructed the tempTxBody
used to estimate the fee, and a second time
with txBodyTerm
where the fee is correct.
The underlying function shelleyWitsVKeyNeeded
computes the necesary (but not sufficient)
key witnesses. The missing ones have to do with MultiSig (and Timelock) scripts and Mir
certificates (ones where isInstantaneousRewards
predicate is True). So we have to add these as well.
A MultiSig (Timelock) scripts needs witnesses for enough Signature scripts to make it True.
MIRCert needs enough witnesses from genDelegs to make the quorum constraint true.
makeKeyWitnessTarget ∷ Reflect era ⇒ Term era (TxBodyF era) → Term era (Set (KeyHash 'Witness)) → Term era (Set (KeyHash 'Witness)) → Term era (Map ScriptHash (ScriptF era)) → Term era (Map (KeyHash 'Payment) (Addr, SigningKey)) → Target era (Set (WitVKey 'Witness)) Source #
makeKeyWitness ∷ ∀ era. Reflect era ⇒ TxBodyF era → Set (KeyHash 'Witness) → Set (KeyHash 'Witness) → Map (KeyHash 'Witness) (KeyPair 'Witness) → Map ScriptHash (ScriptF era) → Map (KeyHash 'Genesis) GenDelegPair → Map (KeyHash 'Payment) (Addr, SigningKey) → Set (WitVKey 'Witness) Source #
adjustNeededByRefScripts ∷ Proof era → Set TxIn → Set TxIn → Map TxIn (TxOutF era) → Set ScriptHash → Set ScriptHash Source #
Starting in the Babbage era, we can adjust the script witnesses by not supplying
those that appear as a reference script in the UTxO resolved spending
inputs.
{- neededHashes − dom(refScripts tx utxo) = dom(txwitscripts txw) -}
This function computes the exact set of hashes that must appear in the witnesses.
getUtxoCoinT ∷ Reflect era ⇒ Term era TxIn → Term era (Map TxIn (TxOutF era)) → Target era Coin Source #
txoutSum ∷ ∀ era t. (Foldable t, Reflect era) ⇒ t (TxOutF era) → Value era Source #
Compute the sum of all the Values in a List(Set,Map, ...) of TxOut
minusMultiValue ∷ ∀ era. Proof era → Value era → Value era → Map ScriptHash (Map AssetName Integer) Source #
txBodyPreds ∷ ∀ era. (HasCallStack, Reflect era) ⇒ UnivSize → Proof era → [Pred era] Source #
adjustFeeInput ∷ (HasCallStack, Reflect era) ⇒ Env era → Typed (Env era) Source #
adjustColInput ∷ (HasCallStack, Reflect era) ⇒ Env era → Typed (Gen (Env era)) Source #
Adjust UTxO image of collateral
to pay for the collateral fees. Do this by
adding extraCol
to the TxOuts associated with col inputs
adjustC ∷ (Ord k, Show k) ⇒ [k] → Map k v → Coin → Lens' v Coin → Maybe (Map k v) Source #
Adjust the part of the UTxO that maps the collateral
inputs, to pay the collateral fee.
This will adjust 1 or more of the TxOuts associated with the collateral , to make up the difference.
It may happen on rare occaisions, there is not enough Coin to make the adjustment, so return Nothing
genTxAndLedger ∷ Reflect era ⇒ UnivSize → Proof era → Gen (LedgerState era, Tx era, Env era) Source #
genTxAndNewEpoch ∷ Reflect era ⇒ UnivSize → Proof era → Gen (NewEpochState era, Tx era, Env era) Source #
pgenTxBodyField ∷ Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxBodyField era → [(Text, PDoc)] Source #
Pretty print the fields of a Randomly generated TxBody, except resolve the inputs with the given Ut map.
pgenTxField ∷ ∀ era. Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxField era → [(Text, PDoc)] Source #