-
Notifications
You must be signed in to change notification settings - Fork 631
[CDEC-509] Remove HasGenesisHash in favour of explicit parameters #3522
Conversation
c96cef7
to
9ba020c
Compare
9ba020c
to
f9a86c0
Compare
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.
This is going to need to be rebased against develop anyway, but I wonder if GenesisHash
should not be included in Config
.
f9a86c0
to
674df8f
Compare
db/src/Pos/DB/Block/Internal.hs
Outdated
-> m (Maybe SerializedBlund) | ||
dbGetSerBlundPureDefault h = do | ||
dbGetSerBlundPureDefault _ h = do |
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.
If we're not even using it, why pass it in?
db/src/Pos/DB/Block/Internal.hs
Outdated
-> m (Maybe SerializedUndo) | ||
dbGetSerUndoPureDefault h = do | ||
dbGetSerUndoPureDefault _ h = do |
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.
Ditto re why pass it in?
loadHeadersByDepth (k + 1) upToReal | ||
-- loadHeadersByDepth always returns nonempty list unless you | ||
-- pass depth 0 (we pass k+1). It throws if upToReal is | ||
-- absent. So it either throws or returns nonempty. |
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.
can we encode this in the type? eg make it return NewestFirst NonEmpty BlockHeader
?
lib/src/Pos/Launcher/Scenario.hs
Outdated
runNode coreConfig txpConfig nr plugins = runNode' coreConfig | ||
nr | ||
workers' | ||
plugins |
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.
This indentation style is too sensitive to changes in lengths of any params or adding/removing any parameters. Instead, prefer something like:
runNode coreConfig txpConfig nr plugs =
runNode'
coreConfig
nr
workers'
plugins
Then a change to a parameter name or addition of a parameter will only affect the relevant line.
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.
Yeah, good point! I'm using Brittany at the moment, so I'll look into a way to remove that kind of indentation...
674df8f
to
334944b
Compare
Description
Almost there with the
Data.Reflection
constraints fromcore
.Linked issue
CDEC-509
Type of change
Developer checklist
Testing checklist
QA Steps
Screenshots (if available)