Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ledger API function for stake distribution and pool parameters query #2511

Merged
merged 9 commits into from
Oct 11, 2021

Conversation

HeinrichApfelmus
Copy link
Contributor

Issue Number

CAD-3480

Summary

module Cardano.Ledger.Shelley.API.Wallet:

  • Introduce and export types RewardParams and RewardInfoPool
  • The getRewardInfoPools function is essentially a refactoring of the getNonMyopicMemberRewards function.
  • Also reorder the functions in the file and export list more thematically.

Comments

Exporting getRewardInfoPools helps the wallet to calculate reward predictions (e.g. stake pool desirability, non-myopic rewards, but also future reward measures) for stake pools. It's intended to become a local state query in the node.

I have made a best effort to conform with the coding conventions in the ledger, but I'm probably off. I did not know where to put the types. Also, I did not know whether or how to write unit tests (though it seems that the old GetRewardProvenance does not have many tests either.)

HeinrichApfelmus and others added 3 commits October 6, 2021 15:28
* Introduce and export types `RewardParams` and `RewardInfoPool`
* The `getRewardInfoPools` function is essentially a refactoring of the `getNonMyopicMemberRewards` function.
* Also reorder the functions in the file and export list more thematically.
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you for leaving this module in better shape than you found it, much appreciated!

Copy link
Contributor

@nc6 nc6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks nice, but a few places where the comments need to be updated/clarified!

-- Stake pools and pool rewards
--------------------------------------------------------------------------------

-- | Get the /current/ registered stake pool parameters for a given set of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This haddock is incorrect!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry.

eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs Outdated Show resolved Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs Outdated Show resolved Hide resolved
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/CAD-3480 branch 2 times, most recently from 4e40729 to 2a20edb Compare October 11, 2021 13:11
@JaredCorduan JaredCorduan merged commit dd970d0 into master Oct 11, 2021
@iohk-bors iohk-bors bot deleted the HeinrichApfelmus/CAD-3480 branch October 11, 2021 21:47
@jackrousian
Copy link

[CAD-3480]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants