-
Notifications
You must be signed in to change notification settings - Fork 156
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
Emit new TotalAdaPotEvent after epoch transition (gh #2780) #2797
Conversation
-- * Ada Pots | ||
AdaPots (..), | ||
totalAdaES, | ||
totalAdaPotsES, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this module should re-export these three items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides re-export the ada pots support in the wallet API, this PR looks good to me!
to avoid calling API functions from within `NewEpoch`
@@ -166,6 +169,8 @@ newEpochTransition = do | |||
-- map is empty (db-sync depends on it). | |||
tellEvent $ TotalRewardEvent e regRU | |||
pure es' | |||
let adaPots = totalAdaPotsES es |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in #2791 (comment) I think es'''
pots better fits what we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Thank you for all the explanation, I'm just about to push a new version with this.
Thanks!
12a5a59
to
58c4000
Compare
Forced push to use |
58c4000
to
c26b8bc
Compare
Force-pushed to retrigger build 🤞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
c26b8bc
to
3d9f369
Compare
Tests are passing on my machine (even after deleting dist-newstyle), so I don't get the failure on CI. Retrying |
This is an alternative to #2791
It is a solution for: #2780
The difference is in how the code is refactored. This PR extracts
AdaPots
in a separate module (outside the API) and uses it fromNewEpoch
, rather than movecalculatePoolDistr
insideWallet.API
.But the question is: do these functions have to be in the API? From what I can tell, there is nothing using them at the moment, but I know little!
Are there better alternatives to this refactoring?