hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Chain.Direct.WalletSpec

Synopsis

Documentation

spec :: Spec Source #

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 #

hasLowFees :: PParams LedgerEra -> Tx TopTx LedgerEra -> Property Source #

isBalanced :: Map TxIn TxOut -> Tx TopTx LedgerEra -> Tx TopTx LedgerEra -> 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,

genUTxO :: Gen (Map TxIn TxOut) Source #

genOutputsForInputs :: Tx TopTx LedgerEra -> Gen (Map TxIn TxOut) Source #

genLedgerTx :: Gen (Tx TopTx LedgerEra) Source #

allTxIns :: [Tx TopTx LedgerEra] -> Set TxIn Source #

allTxOuts :: [Tx TopTx LedgerEra] -> [TxOut] Source #

isOurs :: Map TxIn TxOut -> Address -> Bool Source #

ourDirectInputs :: Map TxIn TxOut -> [Tx TopTx LedgerEra] -> [TxIn] Source #

ourOutputs :: Map TxIn TxOut -> [Tx TopTx LedgerEra] -> [TxOut] Source #

getValue :: TxOut -> Value LedgerEra 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.