You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"I'm using CML to build a TX for minting a one-shot token. Meaning I need to manually specify an input UTxO for the Policy to pass.
I've gotten it to work once, but I think I've encountered a subtle bug on my second run. The input it is specifying has the minimum Coin value, so it shouldn't be enough for an output after fees, but for some reason the let input_total = builder.get_total_input()?; in the method add_change_if_needed(), doesn't add any extra inputs to make up for the difference :(. i.e. add_change_if_needed() fails with the error
"Not enough ADA leftover to include non-ADA assets in a change address"
In playing around with the code, I removed the input UTxO from the transaction builder, just to see what inputs it gave me. And in that case it goes ahead and adds a big juicy UTxO to cover the fees + change (but of course the Policy fails on execution).
Is this a bug? Or could I be doing something different in the tx builder to help it add extra inputs?"
The text was updated successfully, but these errors were encountered:
My current solution is just requiring the "arbitrary" input UTxO to be large enough in the mint_nft dapp. This is still leaving a pitfall for the next person who tries this and hasn't seen my example. Admittedly it is kinda a niche case, there aren't many reasons to mint an NFT and send it directly to your wallet without any other specified outputs, but it definitely could happen.
I'll leave a note, but it all feels like leaking CML.
One possible solution, without trying to get a PR through CML, would be to just check the unbuilt tx in our CML Client, and adding extra inputs if needed. I'd actually prefer that to going through the trouble of debugging the CML code and getting a PR through :P
"I'm using CML to build a TX for minting a one-shot token. Meaning I need to manually specify an input UTxO for the Policy to pass.
I've gotten it to work once, but I think I've encountered a subtle bug on my second run. The input it is specifying has the minimum Coin value, so it shouldn't be enough for an output after fees, but for some reason the let input_total = builder.get_total_input()?; in the method add_change_if_needed(), doesn't add any extra inputs to make up for the difference :(. i.e. add_change_if_needed() fails with the error
"Not enough ADA leftover to include non-ADA assets in a change address"
In playing around with the code, I removed the input UTxO from the transaction builder, just to see what inputs it gave me. And in that case it goes ahead and adds a big juicy UTxO to cover the fees + change (but of course the Policy fails on execution).
Is this a bug? Or could I be doing something different in the tx builder to help it add extra inputs?"
The text was updated successfully, but these errors were encountered: