cardano-ledger-byron-1.0.1.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Chain.Common.LovelacePortion

Synopsis

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

Instances details
ToJSON LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Generic LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Associated Types

type Rep LovelacePortionTypeType Source #

Show LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

FromCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

ToCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

DecCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

EncCBOR LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

NFData LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Methods

rnfLovelacePortion → () Source #

Buildable LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Eq LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Ord LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

HeapWords LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

NoThunks LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

MonadError SchemaError m ⇒ FromJSON m LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

Monad m ⇒ ToJSON m LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

type Rep LovelacePortion Source # 
Instance details

Defined in Cardano.Chain.Common.LovelacePortion

type Rep LovelacePortion = D1 ('MetaData "LovelacePortion" "Cardano.Chain.Common.LovelacePortion" "cardano-ledger-byron-1.0.1.0-inplace" 'True) (C1 ('MetaCons "LovelacePortion" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLovelacePortion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

rationalToLovelacePortionRationalLovelacePortion Source #

Make a LovelacePortion from a Rational which must be in the range [0..1].