Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- scaledMinDeposit ∷ Val v ⇒ v → Coin → Coin
Documentation
scaledMinDeposit ∷ Val v ⇒ v → Coin → Coin Source #
The scaledMinDeposit
calculation uses the minUTxOValue protocol parameter
(passed to it as Coin mv) as a specification of "the cost of making a
Shelley-sized UTxO entry", calculated here by "utxoEntrySizeWithoutVal +
uint", using the constants in the "where" clause. In the case when a UTxO
entry contains coins only (and the Shelley UTxO entry format is used - we
will extend this to be correct for other UTxO formats shortly), the deposit
should be exactly the minUTxOValue. This is the "inject (coin v) == v" case.
Otherwise, we calculate the per-byte deposit by multiplying the minimum
deposit (which is for the number of Shelley UTxO-entry bytes) by the size of
a Shelley UTxO entry. This is the "(mv * (utxoEntrySizeWithoutVal + uint))"
calculation. We then calculate the total deposit required for making a UTxO
entry with a Val-class member v by dividing "(mv * (utxoEntrySizeWithoutVal +
uint))" by the estimated total size of the UTxO entry containing v, ie by
"(utxoEntrySizeWithoutVal + size v)". See the formal specification for
details.
This scaling function is right for UTxO, not EUTxO
Orphan instances
Crypto c ⇒ EraTxOut (MaryEra c) Source # | |
mkBasicTxOut ∷ Addr (EraCrypto (MaryEra c)) → Value (MaryEra c) → TxOut (MaryEra c) Source # upgradeTxOut ∷ TxOut (PreviousEra (MaryEra c)) → TxOut (MaryEra c) Source # valueTxOutL ∷ Lens' (TxOut (MaryEra c)) (Value (MaryEra c)) Source # compactValueTxOutL ∷ Lens' (TxOut (MaryEra c)) (CompactForm (Value (MaryEra c))) Source # valueEitherTxOutL ∷ Lens' (TxOut (MaryEra c)) (Either (Value (MaryEra c)) (CompactForm (Value (MaryEra c)))) Source # addrTxOutL ∷ Lens' (TxOut (MaryEra c)) (Addr (EraCrypto (MaryEra c))) Source # compactAddrTxOutL ∷ Lens' (TxOut (MaryEra c)) (CompactAddr (EraCrypto (MaryEra c))) Source # addrEitherTxOutL ∷ Lens' (TxOut (MaryEra c)) (Either (Addr (EraCrypto (MaryEra c))) (CompactAddr (EraCrypto (MaryEra c)))) Source # getMinCoinSizedTxOut ∷ PParams (MaryEra c) → Sized (TxOut (MaryEra c)) → Coin Source # getMinCoinTxOut ∷ PParams (MaryEra c) → TxOut (MaryEra c) → Coin Source # |