-
Notifications
You must be signed in to change notification settings - Fork 214
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
PLT-45: plutus-tx-constraints #490
Conversation
7374553
to
a7676ad
Compare
So we can compile it to RawJson in PureScript
1116404
to
9eefef8
Compare
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.
Looks good 👍
@@ -333,6 +351,7 @@ initialState = ConstraintProcessingState | |||
, cpsMintRedeemers = mempty | |||
, cpsValueSpentBalancesInputs = ValueSpentBalances mempty mempty | |||
, cpsValueSpentBalancesOutputs = ValueSpentBalances mempty mempty | |||
, cpsParams = def |
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.
Shouldn't we pass it directly?
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.
It's not used here. It is passed directly in plutus-tx-constraints, where it is actually used. I'll add a comment.
* Clone plutus-ledger-constraints * Implement withIsCardanoEra * Support cardano-api Tx's in UnbalancedTx. * Reuse code from pluts-ledger-constraints by importing it * Implement MustPayToPubKeyAddress * A new use of withIsCardanoEra * Fix typo * Fix unbalanced tx export * Generate purs * Fix UnbalancedTx pretty printing * Make CardanoBuildTx a newtype So we can compile it to RawJson in PureScript * Clean up * PR feedback
This result is maybe not what was expected, at least it's not what I expected when I started. But after realising that the
UnbalancedTx
datatype needs to be reused, because it is expected by downstream code, and that the on-chain part is completely unaffected by the move to the cardano-api transaction type, I chose to only rewrite theOffChain
module and re-export theTxConstraints
andOnChain
modules fromplutus-ledger-constraints
.Also I initially thought that users would specify the constraints using cardano-api types for datums, values, hashes etc, but they should remain those from plutus since that's what scripts also receive from the script context.
Pre-submit checklist: