cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Preds.Tx

Synopsis

Documentation

txBodySize ∷ ∀ era. Reflect era ⇒ TxBody era → Int Source #

byteSize ∷ ∀ era a. (EncCBOR a, Reflect era) ⇒ Proof era → a → Int Source #

byteSizeT ∷ ∀ era a. (EncCBOR a, Reflect era) ⇒ Term era a → Target era Int Source #

txFLLens' (TxF era) (Tx era) Source #

computeFinalFeeEraUTxO era ⇒ PParamsF era → TxF era → Map TxIn (TxOutF era) → Coin Source #

integrityHashEra 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

sufficientGenDelegsMap k GenDelegPairSet (KeyHash 'Witness) Source #

Get enough GenDeleg KeyHashes to satisfy the quorum constraint.

sufficientScriptKeysProof 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.

pcUtxoReflect era ⇒ Map TxIn (TxOutF era) → String Source #

pcUtxoDocReflect era ⇒ Map TxIn (TxOutF era) → PDoc 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) GenDelegPairSet (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.

makeKeyWitnessTargetReflect 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 #

adjustNeededByRefScriptsProof era → Set TxInSet TxInMap TxIn (TxOutF era) → Set ScriptHashSet 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.

getUtxoCoinTReflect era ⇒ Term era TxInTerm era (Map TxIn (TxOutF era)) → Target era Coin Source #

getNTxOut ∷ (HasCallStack, Reflect era) ⇒ SizeTxOutF era → [TxOutF era] → [TxOutF era] 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) ⇒ UnivSizeProof era → [Pred era] Source #

txBodyStageReflect era ⇒ UnivSizeProof era → Subst era → Gen (Subst era) Source #

balanceMapOrd k ⇒ [(k, Coin)] → Map k t → Lens' t CoinMap k t Source #

adjustFeeInput ∷ (HasCallStack, Reflect era) ⇒ Env era → Typed (Env era) Source #

Adjust the Coin part of the TxOut in the utxo map for the TxIn feeTxIn by adding txfee

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 → CoinLens' v CoinMaybe (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

updateVal ∷ (a → b → a) → Term era a → b → Env era → Typed (Env era) Source #

updateTerm ∷ (a → b → a) → Term era a → Term era b → Env era → Typed (Env era) Source #

updateTarget ∷ (a → b → a) → Term era a → Target era b → Env era → Typed (Env era, b) Source #

override ∷ x → x → x Source #

genTxAndLedgerReflect era ⇒ UnivSizeProof era → Gen (LedgerState era, Tx era, Env era) Source #

genTxAndNewEpochReflect era ⇒ UnivSizeProof era → Gen (NewEpochState era, Tx era, Env era) Source #

demoTxIO () Source #

goneGen (IO ()) Source #

testMaybe IntIO () Source #

bad ∷ [Int] Source #

goIntIO () Source #

pgenTxBodyFieldReflect 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.

pgenTxBodyReflect era ⇒ Proof era → TxBody era → Map TxIn (TxOutF era) → PDoc Source #

pgenTxField ∷ ∀ era. Reflect era ⇒ Proof era → Map TxIn (TxOutF era) → TxField era → [(Text, PDoc)] Source #

pgenTxReflect era ⇒ Proof era → Map TxIn (TxOutF era) → Tx era → PDoc Source #

pcTxWithUTxOReflect era ⇒ Proof era → UTxO era → Tx era → PDoc Source #

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))) ⇒ UnivSizeProof era → Gen Property Source #

main1IO () Source #

main2IO () Source #

demoReplModeIO () Source #

mainIO () Source #