IntersectMBO / IntersectMBO/cardano-ledger
make the danger in `epochInfo` more apparent.
Open
:credit_card: technical-debt
- Dominant language
- Haskell
- Stars
- 295
- Forks
- 179
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 29
Description
We should document and make clearer the circumstances when the methods associated with `epochInfo` return `Left`.
In particular, we often do the following to get the first slot of the next epoch:
```
ei <- liftSTS $ asks epochInfo
EpochNo e <- liftSTS $ epochInfoEpoch ei s
let newEpochNo = EpochNo (e + 1)
firstSlotNextEpoch <- liftSTS $ epochInfoFirst ei newEpochNo
```
This construction works, but would not, for example, if we let `newEpochNo = EpochNo (e + 2)`. This construction could perhaps be a good standalone function.
Contributor guide
Assessment
This issue has not been assessed yet.