-
Notifications
You must be signed in to change notification settings - Fork 25
Add MuxError handling in FoldBlocksError #548
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
Conversation
| , LedgerStateCondition(..) | ||
| , ConditionResult(..) | ||
| , fromConditionResult | ||
| , toConditionResult |
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'm not super satisfied with those names. Any suggestions are welcome here.
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.
For fromConditionResult you could call it: isConditionMet or wasConditionMet. For toConditionResult, I am not sure what could be better, one idea would be simply conditionResult, because it is kind of a smart constructor. Or conditionResultMet?
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.
But it doesn't look like it is being used
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.
Those names are fine to me. Explicit and not too long. I'd keep them 👍
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.
They're meant to be used in cardano-testnet if needed. Example usage:
fooCallbck = do
...
pure $ toConditionResult isSkyBlueor
fooCallbck = do
...
pure $ conditionResult isSkyBlueNot sure which one is more obvious. I think I'll stick to toConditionResult as it signals simple conversion.
palas
left a comment
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.
Looks good 👍
| , LedgerStateCondition(..) | ||
| , ConditionResult(..) | ||
| , fromConditionResult | ||
| , toConditionResult |
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.
For fromConditionResult you could call it: isConditionMet or wasConditionMet. For toConditionResult, I am not sure what could be better, one idea would be simply conditionResult, because it is kind of a smart constructor. Or conditionResultMet?
| , LedgerStateCondition(..) | ||
| , ConditionResult(..) | ||
| , fromConditionResult | ||
| , toConditionResult |
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.
But it doesn't look like it is being used
smelc
left a comment
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 👍
| , LedgerStateCondition(..) | ||
| , ConditionResult(..) | ||
| , fromConditionResult | ||
| , toConditionResult |
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.
Those names are fine to me. Explicit and not too long. I'd keep them 👍
b324de5 to
c615f8a
Compare
| , LedgerStateConway #-} | ||
|
|
||
| data FoldBlocksError | ||
| = FoldBlocksInitialLedgerStateError !InitialLedgerStateError |
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.
We should also change the name of this type to something like NewEpochStateError (not necessary for this PR).
c615f8a to
6a2f5df
Compare
Changelog
Context
Moves handling of errors removed in
to
cardano-api. Seems that linking of epoch state logging thread sometimes results in errors:or
e.g. https://github.com/IntersectMBO/cardano-node/pull/5869/checks?check_run_id=25887156950. This change should let that error be captured by
FoldBlocksError.Also follow-up from
to make
LedgerStateConditionmore reusable.Checklist