cardano-ledger-core-1.16.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Rewards

Synopsis

Documentation

data RewardType Source #

The staking rewards in Cardano are all either:

  • member rewards - rewards given to a registered stake credential which has delegated to a stake pool, or
  • leader rewards - rewards given to a registered stake pool (in particular, given to the stake credential in the stake pool registration certificate).

See Figure 47, "Functions used in the Reward Splitting", of the formal specification for more details.

Constructors

MemberReward 
LeaderReward 

Instances

Instances details
ToJSON RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Bounded RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Enum RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Generic RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Associated Types

type Rep RewardTypeTypeType Source #

Show RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

DecCBOR RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

EncCBOR RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

encCBORRewardTypeEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy RewardTypeSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [RewardType] → Size Source #

NFData RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

rnfRewardType → () Source #

Eq RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Ord RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

NoThunks RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

type Rep RewardType Source # 
Instance details

Defined in Cardano.Ledger.Rewards

type Rep RewardType = D1 ('MetaData "RewardType" "Cardano.Ledger.Rewards" "cardano-ledger-core-1.16.0.0-inplace" 'False) (C1 ('MetaCons "MemberReward" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "LeaderReward" 'PrefixI 'False) (U1TypeType))

data Reward c Source #

The Reward type captures:

  • if the reward is a member or leader reward
  • the stake pool ID associated with the reward
  • the number of Lovelace in the reward

Constructors

Reward 

Instances

Instances details
Crypto c ⇒ ToJSON (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Generic (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Associated Types

type Rep (Reward c) ∷ TypeType Source #

Methods

fromReward c → Rep (Reward c) x Source #

toRep (Reward c) x → Reward c Source #

Show (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

showsPrecIntReward c → ShowS Source #

showReward c → String Source #

showList ∷ [Reward c] → ShowS Source #

Crypto c ⇒ DecCBOR (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

decCBORDecoder s (Reward c) Source #

dropCBORProxy (Reward c) → Decoder s () Source #

labelProxy (Reward c) → Text Source #

Crypto c ⇒ EncCBOR (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

encCBORReward c → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Reward c) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Reward c] → Size Source #

NFData (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

rnfReward c → () Source #

Eq (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

Methods

(==)Reward c → Reward c → Bool Source #

(/=)Reward c → Reward c → Bool Source #

Ord (Reward c) Source #

Note that this Ord instance is chosen to align precisely with the Allegra reward aggregation, as given by the function aggregateRewards so that findMax returns the expected value.

Instance details

Defined in Cardano.Ledger.Rewards

Methods

compareReward c → Reward c → Ordering Source #

(<)Reward c → Reward c → Bool Source #

(<=)Reward c → Reward c → Bool Source #

(>)Reward c → Reward c → Bool Source #

(>=)Reward c → Reward c → Bool Source #

maxReward c → Reward c → Reward c Source #

minReward c → Reward c → Reward c Source #

NoThunks (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

type Rep (Reward c) Source # 
Instance details

Defined in Cardano.Ledger.Rewards

type Rep (Reward c) = D1 ('MetaData "Reward" "Cardano.Ledger.Rewards" "cardano-ledger-core-1.16.0.0-inplace" 'False) (C1 ('MetaCons "Reward" 'PrefixI 'True) (S1 ('MetaSel ('Just "rewardType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardType) :*: (S1 ('MetaSel ('Just "rewardPool") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool c)) :*: S1 ('MetaSel ('Just "rewardAmount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))