Skip to content

Commit

Permalink
Rename getRewardInfo to getRewardProvenance
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed Oct 11, 2021
1 parent 0c919bd commit 4e40729
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Cardano.Ledger.Shelley.API.Wallet
RewardInfoPool (..),
RewardParams (..),
getRewardInfoPools,
getRewardProvenance,
getRewardInfo,
getNonMyopicMemberRewards,

Expand Down Expand Up @@ -440,13 +441,31 @@ getRewardInfoPools globals ss =
mempty
(_poolOwners poolp)

{-# DEPRECATED getRewardInfo "Use 'getRewardProvenance' instead." #-}
getRewardInfo :: forall era.
( HasField "_a0" (Core.PParams era) NonNegativeInterval,
HasField "_d" (Core.PParams era) UnitInterval,
HasField "_nOpt" (Core.PParams era) Natural,
HasField "_protocolVersion" (Core.PParams era) ProtVer,
HasField "_rho" (Core.PParams era) UnitInterval,
HasField "_tau" (Core.PParams era) UnitInterval
) =>
Globals ->
NewEpochState era ->
(RewardUpdate (Crypto era), RewardProvenance (Crypto era))
getRewardInfo = getRewardProvenance

-- | Calculate stake pool rewards from the snapshot labeled `go`.
-- Also includes information on how the rewards were calculated
-- ('RewardProvenance').
--
-- For a calculation of rewards based on the current stake distribution,
-- see 'getRewardInfoPools'.
getRewardInfo ::
--
-- TODO: Deprecate 'getRewardProvenance', because wallets are more
-- likely to use 'getRewardInfoPools' for up-to-date information
-- on stake pool rewards.
getRewardProvenance ::
forall era.
( HasField "_a0" (Core.PParams era) NonNegativeInterval,
HasField "_d" (Core.PParams era) UnitInterval,
Expand All @@ -458,7 +477,7 @@ getRewardInfo ::
Globals ->
NewEpochState era ->
(RewardUpdate (Crypto era), RewardProvenance (Crypto era))
getRewardInfo globals newepochstate =
getRewardProvenance globals newepochstate =
runReader
( runWithProvM def $
createRUpd slotsPerEpoch blocksmade epochstate maxsupply asc secparam
Expand Down

0 comments on commit 4e40729

Please sign in to comment.