-
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
Minting doesn't need special treatment after all #267
Conversation
1679a20
to
d12e208
Compare
d12e208
to
f4c9683
Compare
@@ -405,52 +404,23 @@ handleBalanceTx utxo UnbalancedTx{unBalancedTxTx} = do | |||
-- | Adjust the left and right balance of an unbalanced 'Tx' with the missing | |||
-- lovelace considering the minimum lovelace per transaction output constraint | |||
-- from the Cardano blockchain. | |||
adjustBalanceWithMissingLovelace :: |
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.
🥳
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.
Nice refactoring!
let val = vL 200 | ||
lookups = Constraints.mintingPolicy coinMintingPolicy | ||
constraints = Constraints.mustMintValue val | ||
<> Constraints.mustPayToPubKey pkh (val <> Ada.toValue Ledger.minAdaTxOut) |
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.
If I'm understanding correctly, if the constraints is:
Constraints.mustMintValue val <> Constraints.mustPayToPubKey pkh val
instead, then the new balancing logic in the emulator will not try to add the min Ada to the output containing the minted token? So the transaction will just fail unless we call adjustUnbalanceTx
?
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.
Yes, this is consistent with the other Constraints right?
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.
Yes it seems consistent! Thanks :)
Fixes #263
Pre-submit checklist: