-
Notifications
You must be signed in to change notification settings - Fork 214
Adjusting unbalanced transaction doesn't work in certain cases #143
Comments
The behaviour seems to:
I've edited your first example here: jankun4/minimum-ada-bug#1 here's the trace.
|
We are having some trouble with this new feature too. Might be worth contributing our 2cents in here. I believe that
That will submit a transaction with no outputs, because Another one,
Now it will submit a tx, but it will alter the value to |
This issue is fixed by #229. The filtering of outputs with a datum but with 0 value is gone.
|
Summary
Let's say we want to submit 2 transactions:
By using
adjustUnbalancedTx
we can successfully perform transaction 1. After submitting it, there is a UTxO at the script address with the specified amount of our custom coin and 2 Ada. However, we cannot successfully perform transaction 2. If we try we will getValueContainsLessThanMinAda
exception. What is strange is that we can consume this UTxO without problems if we don't create a new UTxO in the same transaction. The problem also doesn't occur if UTxO made by transaction 1 contains 2Ada + collateral amount (3047 Lovelace) + 1 Lovelace (2003048 Lovelace in total).By analyzing the error message, it seems like transaction 2 correctly adjusts txOuptut that goes to the script. However, one of the txOutputs that go back to the wallet contains only the custom coin stored in the first UTxO and 0 Ada.
Steps to reproduce
git clone https://github.com/jankun4/minimum-ada-bug.git
cd minimum-ada-bug
nix-shell
cabal run plutus-starter -- 0 put
- UTxO from transaction 1 has 2Ada (by usingadjustUnbalancedTx
) and transaction 2 creates new UTxOcabal run plutus-starter -- 0
-- UTxO from transaction 1 has 2 Ada and transaction 2 doesn't create a new UTxOcabal run plutus-starter -- 2003048 put
-- UTxO from transaction 1 has 2,003048Ada and transaction 2 creates new UTxOExpected behavior
cabal run plutus-starter -- 0 put
cabal run plutus-starter -- 0
cabal run plutus-starter -- 2003048 put
The text was updated successfully, but these errors were encountered: