-
Notifications
You must be signed in to change notification settings - Fork 217
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
Don't fetch nOpt another time #1982
Conversation
nOpt is returned as part of the `stakeDistribution` function. It was originally added for the purpose of calculating saturation. Recently, along with logic for handling pools not-yet in the stake distribution, this was added: ``` pp <- liftIO $ getProtocolParameters nl ``` also for the sake of retrieving nOpt (aka desiredNumberOfStakePools). It is both slightly confusing to retrieve it from two different places, and they are no longer guaranteed to be from the same point.
@@ -272,11 +276,11 @@ data PoolDbData = PoolDbData | |||
combineDbAndLsqData | |||
:: forall m. (Monad m) | |||
=> TimeInterpreter m | |||
-> ProtocolParameters | |||
-> Int -- ^ nOpt; desired number of pools |
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.
Do we need a newtype DesiredNumberOfPools
?
I'm not sure the need is really there yet, and making all the other packages compile again can be slightly annoying, so I didn't do it.
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.
hmm, I do not see this newtype:
pawel@pure:~/Work/IOHK/cardano-wallet (master)$ ag DesiredNumberOfPools
lib/core/src/Cardano/Wallet/DB/Sqlite/TH.hs
168: protocolParametersDesiredNumberOfPools Word16 sql=desired_pool_number
lib/core/src/Cardano/Wallet/DB/Sqlite.hs
450: addColumn conn True (DBField ProtocolParametersDesiredNumberOfPools) value
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.
one less rountrip. lgtm !
bors r+ |
1982: Don't fetch nOpt another time r=Anviking a=Anviking # Issue Number #1981 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Re-use the existing `nOpt` instead of fetching it again # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
Build failed
|
bors r+ |
Build succeeded |
Issue Number
#1981
Overview
nOpt
instead of fetching it againComments