-
Notifications
You must be signed in to change notification settings - Fork 17
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
KeyError raised for pending funds in wallets with single assets #14
Comments
I would guess that this is the case for any transaction made from a wallet that consumes all UTXOs for all the non-ada assets in the wallet. So I would assume even if there are two assets in the wallet, if a single transaction is called that consumes all the UTXOs containing both assets, you would get this issue. What happens if all the UTXOs for one asset are consumed and pending, but the other asset still has UTXOs left? I'm not sure, I haven't tested it, worth taking a look. |
I've done some more testing - it turns out that even if there are many distinct AssetIDs held in a wallet, if any single one of them have all their UTXOs exhausted by pending transactions, then any call to wallet.assets() will result in a KeyError. |
Hi, |
There is a situation where KeyError is raised: if a wallet has a single (non-ADA) asset, then if all UTXOs containing that asset are consumed in a transaction, calling wallet.assets() while the transaction is pending (and change has not arrived yet) raises the following KeyError:
To illustrate, there are two situations where the error can be replicated:
First:
Send 10 ADA and 1000 asset A to a fresh wallet X with address Y (so wallet X contains a single UTXO at address Y, and nothing else.)
Submit a transaction on wallet X sending 500 units of asset A to address Y (internal transaction).
Call walletX.assets() before the transaction is confirmed - the above KeyError should be raised.
Second:
Assume wallet X has two UTXOs, each having 5 ADA and 500 asset A.
If you submit a transaction on wallet X sending 500 units of asset A to address Y, there is no issue calling walletX.assets(), it will display 'available' asset A as 500 units as expected, as one of the UTXOs is not consumed. But any transaction that requires the consumption of all inputs of asset A (ie, sending self 600 ADA) will cause KeyError to be raised if walletX.assets() is called whilst pending confirmation.
The text was updated successfully, but these errors were encountered: