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

isBalanced :: Map TxIn TxOut -> Tx LedgerEra -> Tx LedgerEra -> Property Source #

genChainPoint :: Gen ChainPoint Source #

Generate a chain point with a likely invalid block header hash.

genChainPointAt :: SlotNo -> Gen ChainPoint Source #

Generate a chain point at given slot with a likely invalid block header hash.

genTxsSpending :: Map TxIn TxOut -> Gen [Tx 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 LedgerEra -> Gen (Map TxIn TxOut) Source #

genLedgerTx :: Gen (Tx LedgerEra) Source #

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

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

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

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

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

getValue :: TxOut -> Value LedgerEra Source #

deltaValue :: Value LedgerEra -> Value LedgerEra -> Value LedgerEra Source #

knownInputBalance :: Map TxIn TxOut -> Tx LedgerEra -> Value LedgerEra Source #

NOTE: This does not account for withdrawals

outputBalance :: Tx LedgerEra -> Value LedgerEra Source #

NOTE: This does not account for deposits