HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulecardano-ledger-shelley-test-1.9.0.0Haskell2010

Test.Cardano.Ledger.Shelley.Generator.Utxo

  • 1 type
  • 3 values
valuegenTx
  1. :: (EraGen era, EraUTxO era, ShelleyEraAccounts era, Embed (EraRule "DELPL" era) (CERTS era), Environment (EraRule "DELPL" era) ~ DelplEnv era, State (EraRule "DELPL" era) ~ CertState era, Signal (EraRule "DELPL" era) ~ TxCert era, Crypto c)
  2. => GenEnv c era
  3. -> LedgerEnv era
  4. -> LedgerState era
  5. -> Gen (Tx TopTx era)
#

Generates a transaction in the context of the LEDGER STS environment and state.

A generated transaction may not have sufficient spending balance and need to be discarded. In that case we try to compute a Delta, that when added (applyDelta) to the transaction, repairs it. The repair is made by adding additional inputs from which more Ada can flow into the fee. If that doesn't fix it, we add more inputs to the Delta. Experience shows that this converges quite quickly (in traces we never saw more than 3 iterations).

datadata Delta era
#

Collect additional inputs (and witnesses and keys and scripts) to make the transaction balance.

Instances2Eq, Show
  • (EraTxOut era, Eq (TxWits era)) => Eq (Delta era)Defined in cardano-ledger-shelley-test-1.9.0.0 · Test.Cardano.Ledger.Shelley.Generator.Utxo
    • We need this instance to know when delta has stopped growing. We don't actually need to compare all the fields, because if the extraInputs has not changed then the Scripts and keys will not have changed.

  • Show (Delta era)Defined in cardano-ledger-shelley-test-1.9.0.0 · Test.Cardano.Ledger.Shelley.Generator.Utxo
valuepickRandomFromMap :: Int -> Map k t -> Gen [(k, t)]
#

Select n random key value pairs from the supplied map. Order of keys with respect to each other will also be random, i.e. not sorted.