TxBodyContent refactoring related fixes#1093
Conversation
2f27bcb to
94d2bf5
Compare
a4bf7e5 to
b849b1e
Compare
b849b1e to
5595edb
Compare
294ecd9 to
b210b64
Compare
palas
left a comment
There was a problem hiding this comment.
Looks good 👍. Just a typo and a suggestion
| case Map.lookup idx exUnitsMap of | ||
| Nothing -> | ||
| Left $ TxBodyErrorScriptWitnessIndexMissingFromExecUnitsMap idx exUnitsMap | ||
| Just exunits -> | ||
| Right $ | ||
| AnyScriptWitnessPlutus $ | ||
| updatePlutusScriptWitnessExecutionUnits exunits psw |
There was a problem hiding this comment.
This bit should probably be a separate function because it is identical to the bit in substituteExecUnits. Maybe substituteExecUnitsInPsw.
There was a problem hiding this comment.
It's not, they return different types unless I'm misunderstanding what you're referring to.
There was a problem hiding this comment.
Ah, you are right, I hadn't seen that. But still, you could probably abstract everything but the AnyScriptWitnessPlutus / AnyPlutusScriptWitness constructor call, and do it outside of substituteExecUnitsInPsw with fmap. Your call though
There was a problem hiding this comment.
Ah yes, I pushed the refactor, thanks.
| proxyToAsType _ = AsConwayEra | ||
|
|
||
| instance HasTypeProxy L.DijkstraEra where | ||
| data AsType L.DijkstraEra = AsDijkstraEra |
There was a problem hiding this comment.
You have not exported the name constructors here. Additionally, there would be a name clash between definitions of our eras and ledger eras, since the constructors have the same name: https://github.com/IntersectMBO/cardano-api/blob/mgalazyn/proto-lens-ghc-9.12/cardano-api/src/Cardano/Api/Era/Internal/Core.hs#L108-L108
Perhaps it's the sign to switch to using ledger eras everywhere?
There was a problem hiding this comment.
I think we should switch to using the ledger's type level era tags in the future but I think I found a better solution for now.
176b5a0 to
06fd44c
Compare
06fd44c to
c0f90ed
Compare
Expose calculateMinimumUTxO
Review fixes
c0f90ed to
02f3830
Compare
| ToApiEra L.MaryEra = Api.MaryEra | ||
| ToApiEra L.AllegraEra = Api.AllegraEra | ||
| ToApiEra L.ShelleyEra = Api.ShelleyEra | ||
| ToApiEra L.ByronEra = Api.ByronEra |
There was a problem hiding this comment.
I'm not a fan of duplicating translation between two types, but I guess for a temporary measure this is fine.
Changelog
Resolves:
TxOutdefinition can be refactored #1084UnsignedTx#1089Context
Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist