Improve docs, error handling, and ergonomics#527
Merged
Conversation
Phase A — code quality: - AutoFilling: drop fromJust in autoFillWithdrawalAmounts, fix constitution haddock and a malformed section header. - Pretty/Skeleton: fix a latent fromJust crash when printing default TxSkelOpts. Documentation: - Reconcile doc/BALANCING.md and doc/CHEATSHEET.md with the current API. - Fix source haddock typos (Output, Signatory, Skeleton). - Homogenize optics haddock comments across the Skeleton modules, using a verb-per-kind convention (Retrieves/Focuses on/Builds or retrieves/An isomorphism) matching doc/OPTICS.md. Robustness / error handling: - Body and Certificate transaction generation now include the underlying error detail in their failure messages. - A ParameterChange governance action carrying a CostModels update now fails with an explicit MCEUnsupportedFeature error instead of silently dropping it. Ergonomics: - Add withReferenceInput to attach a reference input to a TxSkelRedeemer, replacing the verbose set txSkelRedeemerMReferenceInputL (Just …) idiom, and update the CHEATSHEET accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use strict foldl' for accumulating folds that build maps/values: mcstToUtxoState (State), the withdrawals iso and ToValue instance (Withdrawal), and the mints policy-tokens setter and iso (Mint). This avoids building up thunks in the accumulator. - DoubleSat.deltaBalance now tests input membership with Map.member instead of `elem` over Map.keys, removing an intermediate list and giving O(log n) lookups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- doc/OPTICS.md: document the per-kind Haddock comment convention used for optics across the Skeleton modules (verb determined by the optic kind). - Body and Certificate transaction generation now signal their translation failures with an explicit `throw (MCEFailure …)` instead of relying on the `Fail` effect, addressing the two long-standing TODOs at these sites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase A — code quality:
Documentation:
Robustness / error handling:
Ergonomics: