Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- genTx ∷ ∀ era. (EraGen era, EraUTxO 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) ⇒ GenEnv era → LedgerEnv era → LedgerState era → Gen (Tx era)
- data Delta era = Delta {
- dfees ∷ Coin
- extraInputs ∷ Set TxIn
- extraWitnesses ∷ TxWits era
- change ∷ TxOut era
- deltaVKeys ∷ [KeyPair 'Witness]
- deltaScripts ∷ [(Script era, Script era)]
- encodedLen ∷ ∀ era t. (Era era, EncCBOR t) ⇒ t → Integer
- pickRandomFromMap ∷ Int → Map k t → Gen [(k, t)]
Documentation
genTx ∷ ∀ era. (EraGen era, EraUTxO 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) ⇒ GenEnv era → LedgerEnv era → LedgerState era → Gen (Tx era) Source #
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).
Collect additional inputs (and witnesses and keys and scripts) to make the transaction balance.
Delta | |
|