-
Notifications
You must be signed in to change notification settings - Fork 727
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
tx-generator cleanups #4231
tx-generator cleanups #4231
Conversation
75cb9b6
to
d798c19
Compare
* Merge `createChangeInEra` with `createScriptChange`. * Make `mkUTxOScript` polymorphic on the era.
2055ead
to
80d2cd8
Compare
80d2cd8
to
aa5d5bb
Compare
@@ -66,6 +69,22 @@ getFundLovelace (Fund (InAnyCardanoEra _ a)) = case _fundVal a of | |||
TxOutAdaOnly _era l -> l | |||
TxOutValue _era v -> selectLovelace v | |||
|
|||
|
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.
Maybe a dummy question... if we don't actually want it, what's the motivation for ruling out era transitions in this context? Would be great if the comment could provide that info.
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.
So there are two 'era's in play: The era
when the fund is created (this is wrapped an InAnyCardanoEra
) and the era
from getFundWitness :: forall era. IsShelleyBasedEra era => Fund -> Witness WitCtxTxIn era
(That is basically when trying to spend the fund.)
getFundWitness
must be partial (for example it makes no sense to spend funds in an earlier era
that that not support a specific feature). But the way it was done here simply enforced that both era
s are the same.
That was just lazyness on my side because writing the most general possible function is clunky.
So it does not intentionally rule out era transitions but it is a feature is just not implemented at the moment.
bors r+ |
Build succeeded: |
createChangeInEra
withcreateScriptChange
.mkUTxOScript
polymorphic on the era.runBenchmarkInEra
withrunPlutusBenchmark
.runBenchmark
can now create transactions that contain any mix of normal and plutus inputs.ToUTxO era = [Lovelace] -> ([TxOut CtxTx era], TxId -> [Fund])
toToUTxO era = Lovelace -> (TxOut CtxTx era, TxIx -> TxId -> Fund)
(Deal with every output of a TX individually. Notice : The new new type is more restricted than the old version.
This change DOES not add new capabilities (but simplifies some parts of the code )