| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Ledger.CardanoSpec
Synopsis
- spec :: Spec
- shouldParseJSONAs :: forall a. (HasCallStack, FromJSON a) => LByteString -> Expectation
- roundtripPParams :: PParams LedgerEra -> Property
- applyTransactionsEquivalence :: Property
- appliesValidTransaction :: Property
- appliesValidTransactionFromJSON :: Property
- reapplyEquivalence :: Property
- reapplyRejectsExpired :: Property
- propRealisticValue :: Value -> Property
- propHasEnoughLovelace :: TxOut CtxUTxO -> Property
- propGeneratesGoodTxOut :: TxOut CtxUTxO -> Property
- utxoIsThunkFree :: UTxO -> Property
- prop_applyTransactionsThunkFree :: Property
- prop_utxoFromTxThunkFree :: Property
- prop_adjustUTxOThunkFree :: Property
- prop_applyTxToThunkFree :: Property
- prop_jsonDecodeThunkFree :: Property
- prop_cborDecodeThunkFree :: Property
- multiEraHistory :: EraHistory
- genNonCanonicalHashableScriptData :: Gen HashableScriptData
Documentation
shouldParseJSONAs :: forall a. (HasCallStack, FromJSON a) => LByteString -> Expectation Source #
roundtripPParams :: PParams LedgerEra -> Property Source #
Test that the PParams To/FromJSON instances to roundtrip.
applyTransactionsEquivalence :: Property Source #
appliesValidTransaction :: Property Source #
appliesValidTransactionFromJSON :: Property Source #
reapplyEquivalence :: Property Source #
reapplyRejectsExpired :: Property Source #
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 #
prop_applyTransactionsThunkFree :: Property Source #
prop_utxoFromTxThunkFree :: Property Source #
prop_adjustUTxOThunkFree :: Property Source #
prop_applyTxToThunkFree :: Property Source #
prop_jsonDecodeThunkFree :: Property Source #
prop_cborDecodeThunkFree :: 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.