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 (EraCrypto era)) (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 (EraCrypto era1)) (Data era1)) → Target era2 (Maybe (ScriptIntegrityHash (EraCrypto era1))) Source #

needT ∷ ∀ era. EraUTxO era ⇒ Proof era → Target era (TxBodyF era → Map (TxIn (EraCrypto era)) (TxOutF era) → ScriptsNeededF era) Source #

"Construct the Scripts Needed to compute the Script Witnesses from the UTxO and the partial TxBody

bootWitsT ∷ ∀ era. Reflect era ⇒ Proof era → Map (TxIn (EraCrypto era)) (TxOutF era) → TxBodyF era → Map (KeyHash 'Payment (EraCrypto era)) (Addr (EraCrypto era), SigningKey) → Set (BootstrapWitness (EraCrypto era)) Source #

hashBody ∷ ∀ era. Proof era → TxBody era → Hash (EraCrypto era) EraIndependentTxBody Source #

sufficientGenDelegsMap k (GenDelegPair c) → Set (KeyHash 'Witness c) Source #

Get enough GenDeleg KeyHashes to satisfy the quorum constraint.

sufficientTxCert ∷ ∀ era. Reflect era ⇒ [TxCertF era] → Map (KeyHash 'Genesis (EraCrypto era)) (GenDelegPair (EraCrypto era)) → Set (KeyHash 'Witness (EraCrypto era)) Source #

sufficientScriptKeysProof era → Map (ScriptHash (EraCrypto era)) (ScriptF era) → Set (KeyHash 'Witness (EraCrypto era)) 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 (EraCrypto era)) (TxOutF era) → String Source #

pcUtxoDocReflect era ⇒ Map (TxIn (EraCrypto era)) (TxOutF era) → PDoc Source #

necessaryKeyHashTarget ∷ ∀ era. Reflect era ⇒ Term era (TxBodyF era) → Term era (Set (KeyHash 'Witness (EraCrypto era))) → Target era (Set (KeyHash 'Witness (EraCrypto era))) Source #

necessaryKeyHashes ∷ ∀ era. Reflect era ⇒ TxBodyF era → Map (TxIn (EraCrypto era)) (TxOutF era) → Map (KeyHash 'Genesis (EraCrypto era)) (GenDelegPair (EraCrypto era)) → Set (KeyHash 'Witness (EraCrypto era)) → Set (KeyHash 'Witness (EraCrypto era)) 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 (EraCrypto era))) → Term era (Set (KeyHash 'Witness (EraCrypto era))) → Term era (Map (ScriptHash (EraCrypto era)) (ScriptF era)) → Term era (Map (KeyHash 'Payment (EraCrypto era)) (Addr (EraCrypto era), SigningKey)) → Target era (Set (WitVKey 'Witness (EraCrypto era))) Source #

adjustNeededByRefScriptsProof era → Set (TxIn (EraCrypto era)) → Set (TxIn (EraCrypto era)) → Map (TxIn (EraCrypto era)) (TxOutF era) → Set (ScriptHash (EraCrypto era)) → Set (ScriptHash (EraCrypto era)) 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 (TxIn (EraCrypto era)) → Term era (Map (TxIn (EraCrypto era)) (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. Reflect era ⇒ Proof era → Value era → Value era → Map (ScriptHash (EraCrypto era)) (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 (EraCrypto era)) (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 (EraCrypto era)) (TxOutF era) → PDoc Source #

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

pgenTxReflect era ⇒ Proof era → Map (TxIn (EraCrypto era)) (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 #