Deprecate eon-parameterized lenses in favour of direct ledger lenses#1159
Closed
Jimbo4350 wants to merge 1 commit into
Closed
Deprecate eon-parameterized lenses in favour of direct ledger lenses#1159Jimbo4350 wants to merge 1 commit into
Jimbo4350 wants to merge 1 commit into
Conversation
Replace custom eon lenses from Cardano.Api.Tx.Internal.Body.Lens with direct ledger lenses (L.vldtTxBodyL, L.invalidBeforeL, etc.) composed with era constraints. This removes the indirection layer where each lens required an eon witness parameter. Key changes: - Use L.ttlTxBodyL / L.vldtTxBodyL directly instead of invalidHereAfterTxBodyL / invalidBeforeTxBodyL - Use L.mintTxBodyL, L.collateralInputsTxBodyL, etc. directly - Replace adaAssetL/multiAssetL with inline lens in negateLedgerValue - Update L.Witness -> L.Guard (ledger API rename) - Remove duplicate Dijkstra era branches in Output.hs Resolves: #938
Contributor
Author
|
Closing — this work is superseded by the full old-API removal in #1094. |
| createTransactionBody sbe bc = | ||
| shelleyBasedEraConstraints sbe $ do | ||
| (sData, mScriptIntegrityHash, scripts) <- | ||
| (sData, (mScriptIntegrityHash :: StrictMaybe L.ScriptIntegrityHash), scripts) <- |
Check notice
Code scanning / HLint
Redundant bracket Note
| TxOutValueShelleyBased sbe v -> v ^. A.adaAssetL sbe | ||
| TxOutValueShelleyBased sbe v -> | ||
| caseShelleyToAllegraOrMaryEraOnwards | ||
| (\w -> shelleyToAllegraEraConstraints w v) |
Check notice
Code scanning / HLint
Avoid lambda using `infix` Note
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.
Changelog
Context
Resolves #938
Cardano.Api.Tx.Internal.Body.Lenscontains lenses that take an eon witness parameter (e.g.reqSignerHashesTxBodyL :: AlonzoEraOnwards era -> Lens' ...). This PR replaces those with direct use of ledger lenses (L.vldtTxBodyL,L.mintTxBodyL,L.collateralInputsTxBodyL, etc.) composed with the appropriate era constraints at each call site.Key changes:
L.ttlTxBodyL/L.vldtTxBodyLdirectly instead ofinvalidHereAfterTxBodyL/invalidBeforeTxBodyLL.mintTxBodyL,L.collateralInputsTxBodyL,L.reqSignerHashesTxBodyL, etc. directlyadaAssetL/multiAssetLwith inline lens innegateLedgerValueL.Witness->L.Guard(ledger API rename)Output.hsHow to trust this PR
WIP — not yet formatted or build-verified. Review the diff for correctness of lens replacements and era constraint placement.
Checklist