Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell2010 |

# Documentation

data LovelacePortion Source #

`LovelacePortion`

is a legacy Byron type that we keep only for
compatibility. It was originally intended to represent a fraction of stake
in the system. It is used only for the thresholds used in the update system
rules, most of which are now themselves unused. The remaining case is no
longer interpreted as a fraction of all stake, but as a fraction of the
number of genesis keys.

It has enormous precision, due to the fact that it was originally intended to represent a fraction of all stake and can cover the precision of all the Lovelace in the system.

It is represented as a rational nominator with a fixed implicit denominator
of 1e15. So the nominator must be in the range `[0..1e15]`

. This is also the
representation used on-chain (in update proposals) and in the JSON
genesis file.

It is interpreted as a `Rational`

via the provided conversion functions.

#### Instances

rationalToLovelacePortion ∷ Rational → LovelacePortion Source #

Make a `LovelacePortion`

from a `Rational`

which must be in the range `[0..1]`

.

lovelacePortionToRational ∷ LovelacePortion → Rational Source #

Turn a `LovelacePortion`

into a `Rational`

in the range `[0..1]`

.