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 2f37bf0
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs
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,32 @@ 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 +478,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 2f37bf0

Please sign in to comment.