hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Ledger.CardanoSpec

Synopsis

Documentation

spec :: Spec Source #

shouldParseJSONAs :: forall a. (HasCallStack, FromJSON a) => LByteString -> Expectation Source #

roundtripPParams :: PParams LedgerEra -> Property Source #

Test that the PParams To/FromJSON instances to roundtrip.

propRealisticValue :: Value -> Property Source #

A transaction or transaction output can usually only contain a realistic number of native asset entries. This property checks a realistic order of magnitude (100).

propHasEnoughLovelace :: TxOut CtxUTxO -> Property Source #

Check that an output has enough lovelace to cover asset deposits.

propGeneratesGoodTxOut :: TxOut CtxUTxO -> Property Source #

Check that the given TxOut fulfills several requirements and does not use unsupported features. See genTxOut for rationale.

utxoIsThunkFree :: UTxO -> Property Source #

multiEraHistory :: EraHistory Source #

A realistic multi-era EraHistory mimicking mainnet/testnet where: - Byron era: 21600 slotsepoch, 20sslot, runs for 208 epochs (4,492,800 slots) - Shelley+ era: 432000 slotsepoch, 1sslot, open-ended

This causes slot-to-time conversions to differ from a simple fixedEpochInfo because Byron slots are 20x longer than Shelley slots.

genNonCanonicalHashableScriptData :: Gen HashableScriptData Source #

Generate HashableScriptData whose CBOR uses a definite-length array for constructor fields instead of the Plutus-canonical indefinite-length form. Both encodings are valid on L1, but cardano-api's FromJSON re-canonicalises, producing a different hash — the root cause of the replay crash-loop.