| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Chain.Direct.WalletSpec
Synopsis
- spec :: Spec
- setupQuery :: VerificationKey PaymentKey -> IO (ChainQuery IO, QueryPoint -> Expectation)
- mockChainQuery :: VerificationKey PaymentKey -> ChainQuery IO
- mockQueryEpochInfo :: IO (EpochInfo (Either Text))
- mockQueryPParams :: IO (PParams ConwayEra)
- prop_wellSuitedGenerators :: Property
- prop_reducesWhenNotOurs :: Property
- prop_seenInputsAreConsumed :: Property
- prop_setsMinUTxOValue :: Property
- prop_balanceTransaction :: Property
- hasLowFees :: PParams LedgerEra -> Tx TopTx LedgerEra -> Property
- isBalanced :: Map TxIn TxOut -> Tx TopTx LedgerEra -> Tx TopTx LedgerEra -> Property
- prop_picksLargestUTxOToPayTheFees :: Property
- genTxsSpending :: Map TxIn TxOut -> Gen [Tx TopTx LedgerEra]
- genUTxO :: Gen (Map TxIn TxOut)
- genOutputsForInputs :: Tx TopTx LedgerEra -> Gen (Map TxIn TxOut)
- genLedgerTx :: Gen (Tx TopTx LedgerEra)
- allTxIns :: [Tx TopTx LedgerEra] -> Set TxIn
- allTxOuts :: [Tx TopTx LedgerEra] -> [TxOut]
- isOurs :: Map TxIn TxOut -> Address -> Bool
- ourDirectInputs :: Map TxIn TxOut -> [Tx TopTx LedgerEra] -> [TxIn]
- ourOutputs :: Map TxIn TxOut -> [Tx TopTx LedgerEra] -> [TxOut]
- getValue :: TxOut -> Value LedgerEra
- deltaValue :: Value LedgerEra -> Value LedgerEra -> Value LedgerEra
- knownInputBalance :: Map TxIn TxOut -> Tx TopTx LedgerEra -> Value LedgerEra
- outputBalance :: Tx TopTx LedgerEra -> Value LedgerEra
- prop_detectsMissingScript :: Property
- prop_noScriptIntegrityHashWithoutExecution :: Property
- hasReferenceScript :: BabbageTxOut ConwayEra -> Bool
- prop_unrelatedRefScriptDoesNotAffectIntegrityHash :: Property
Documentation
setupQuery :: VerificationKey PaymentKey -> IO (ChainQuery IO, QueryPoint -> Expectation) Source #
mockChainQuery :: VerificationKey PaymentKey -> ChainQuery IO Source #
mockQueryEpochInfo :: IO (EpochInfo (Either Text)) Source #
mockQueryPParams :: IO (PParams ConwayEra) Source #
prop_wellSuitedGenerators :: Property Source #
prop_reducesWhenNotOurs :: Property Source #
prop_seenInputsAreConsumed :: Property Source #
prop_setsMinUTxOValue :: Property Source #
prop_balanceTransaction :: Property Source #
hasLowFees :: PParams LedgerEra -> Tx TopTx LedgerEra -> Property Source #
isBalanced :: Map TxIn TxOut -> Tx TopTx LedgerEra -> Tx TopTx LedgerEra -> Property Source #
prop_picksLargestUTxOToPayTheFees :: Property Source #
genTxsSpending :: Map TxIn TxOut -> Gen [Tx TopTx LedgerEra] Source #
Generate an arbitrary list of transactions from a UTXO set such that, transactions may *sometimes* consume given UTXO and produce new ones. The generator is geared towards certain use-cases,
genOutputsForInputs :: Tx TopTx LedgerEra -> Gen (Map TxIn TxOut) Source #
genLedgerTx :: Gen (Tx TopTx LedgerEra) Source #
ourDirectInputs :: Map TxIn TxOut -> [Tx TopTx LedgerEra] -> [TxIn] Source #
ourOutputs :: Map TxIn TxOut -> [Tx TopTx LedgerEra] -> [TxOut] Source #
deltaValue :: Value LedgerEra -> Value LedgerEra -> Value LedgerEra Source #
knownInputBalance :: Map TxIn TxOut -> Tx TopTx LedgerEra -> Value LedgerEra Source #
NOTE: This does not account for withdrawals
outputBalance :: Tx TopTx LedgerEra -> Value LedgerEra Source #
NOTE: This does not account for deposits
prop_detectsMissingScript :: Property Source #
Test that coverFee detects missing script witnesses. Generates transactions that spend from script-locked UTxOs but omit the script witness.
prop_noScriptIntegrityHashWithoutExecution :: Property Source #
Reference inputs carrying Plutus scripts must not produce a script integrity hash when the transaction executes no scripts (no redeemers, no datums). The ledger expects SNothing in that case and rejects the tx with PPViewHashesDontMatch otherwise.
hasReferenceScript :: BabbageTxOut ConwayEra -> Bool Source #
prop_unrelatedRefScriptDoesNotAffectIntegrityHash :: Property Source #
Transactions that execute scripts while merely referencing unrelated ones must hash only the executed scripts' language views into the script integrity hash. The expected hash is recomputed here against an explicit PlutusV3-only language set: if the unrelated (V2) reference script's language view ever leaked into the hash, or the redeemers on the balanced transaction were not the ones hashed, the comparison fails.